[Solar-talk] Layouts and modifying the view stack
Rodrigo Moraes
rodrigo.moraes at gmail.com
Fri Mar 16 15:05:40 PDT 2007
On 3/16/07, Paul M Jones wrote:
>
> Hi Rodrigo,
>
> On Nov 17, 2006, at 2:37 PM, Rodrigo Moraes wrote:
>
> > By the way, a request: add the /View as a final fallback for the
> > layout stack. This may not seem correct since views are views and
> > layouts are layouts ;-), and I agree that we should try to have as few
> > layouts as we can. But for example, I'm used to make layouts which
> > include *dynamically* a view template or another, and they are never
> > stored in /Layout because they are app related. This is a common need
> > I think (set dynamic templates in layouts), so here is the request
> > that would avoid a initial confusion and perhaps a bit of frustration
> > from people starting with Solar. :-)
>
> As long as I'm messing around with the page-controller in the app
> branch (more replies on that later), do you still think this is a
> worth-while feature to add?
Paul, not anymore I think. The short answer is no, but I don't include view
templates in layouts anymore. My layouts are just empty skeletons and never
have content (content is defined in the Layout or extended Layout classes,
and sometimes uses /View templates to fill the layout variables - a
"template with content" is never included in a layout). So I have _auth.php
in /View, to be able to use it also inside views (don't need anymore to add
/View to the layout stack).
I changed the approach when I started to use a Layout class (wrongly called
Tipos_Response; should be Tipos_Layout, perhaps). It is extended by
different Layout classes (the one I'm using is Tipos_Response_YuiGrids),
which fills layout variables with parsed view templates.
Also I like to have a base skeleton with just the doctype, head and a
variable for the body, which can then be filled with YuiGrids, ___layouts or
css-framework structures. Just reusing the doctype / head / body, but I
think it is handy to have - I always have a base to start no matter which
kind of layout I will use.
Let me know what you think about these ideas.
rodrigo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.killersoft.com/pipermail/solar-talk/attachments/20070316/2cc426b5/attachment.htm
More information about the solar-talk
mailing list