On Sunday, August 14, 2011 8:48:08 PM UTC+2, hammett wrote:
>
> On Sun, Aug 14, 2011 at 10:15 AM, Tomek Pluskiewicz <[email protected]> 
> wrote:
> > In the example web project layouts are defined directly in views. As much 
> as
>
> > like this approach, I don't think it will be possible with Spark, due to 
> the
> > way it renders. However the BaseViewEngine#ResolveView method gets layout
> > paths as parameter. Unfortunately F# is pretty obsure for me at the 
> moment
> > and I couldn't find where in code these layout names are resolved. Is 
> this
> > implemented already?
>
> So in previous design the view engine was also responsible for
> implementing the "convention" for resolving the views/layouts. I
> separated that since I dont think this responsibility should lie with
> them.
>
> Currently this is how it looks
>
>   ViewRequest -> IViewFolderLayout -> IViewEngine
>
> A controller can "decide" to render a view. It creates a viewrequest,
> which is handed to DefaultViewFolderLayout so it fills the possible
> locations. The view engine then tries to load the view sources from
> these locations. The ViewRendererService coordinates these steps.
>
I'm not sure I follow. On ViewRequest there is just a single layout name. 
Not an array. That imposes a question. What do I do to pass multiple, nested 
layouts the way it was possible with MR2's LayoutsAttribute? Would I have to 
create a new IViewFolderLayout implementation? This seems quite heavy...

Also I'm not sure where is that ViewRequest really created. As I understand 
a Controller 'decides' which layout/view to render based on 
ViewResult#LayoutName and ViewResult#ViewName.

Another thing I find missing is the possibility to choose View/Layout on 
ContentNegotiatedResult. Otherwise how is is possible to choose layout and 
view when client requests html? It seems however that it will all become 
clear when I fully understand the ViewRequest.

> > 2. HtmlResult
> > This is F# and not MonoRail question. In my workaround for the Form.For
> > functionality I needed implicit cast operator for HtmlResult. Are cast
> > operators overloadable in F#? I couldn't find an answer on MSDN.
>
> This is a good question. I'm not sure myself. Do you need to
> implicitly cast HtmlResult to string?
>

I need the implicit cast temporarily until there is a better way to wrap up 
transitions with Spark. Verbose enough I just didn't want another ToString() 
call and I was surprised I couldn't find that implicit casting... For now I 
simply derived in C#. 

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-devel/-/zOrfTeCx2AwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en.

Reply via email to