[Solar-talk] layout path stack
Rodrigo Moraes
rodrigo.moraes at gmail.com
Mon Oct 1 15:45:46 CDT 2007
On 10/1/07, Jeff Surgeson wrote:
> My Vendor_App_Class extends from Vendor_App_Base which extends
> Solar_Controller_page.
Hey, Jeff!
The layout path stack is built using the class parents, so if your app
doesn't extend Solar_App_Base, you won't have Solar/App/Base/Layout in
the stack.
> Is there a reason for this or am I missing something? do I need to add
> Solar_App_Base_Layout to the stack? Looking at Solar_App's as well as some of
> Rodrigos app's it would seem not, however Rodrigo does not use Solar Layouts
> only his own. I tend to use Solar's _head and some of the other layout
> template's so it was nice that I did not have to duplicate existing Solar
> templates only the ones I needed to change.
>
> Is this a bad thing, should I only be using my own templates, if so why?
Well, I think Solar is doing the right thing, only adding to the stack
layout dirs related to the app class and its parents. This way, it
does not force you to use Solar/App/Base/Layout as a fall back. It
seems a good thing to not add a layout path from an *external app*
(even if it is a Solar app).
At the same time, you can add it easily extending your apps from
Solar_App_Base *or* adding the path in your
Vendor_App_Base::_setLayoutTemplates():
protected function _setLayoutTemplates()
{
parent::_setLayoutTemplates();
$this->_view_object->addTemplatePath('Solar/App/Base/Layout');
}
I hope this is correct. =)
-- rodrigo
More information about the Solar-talk
mailing list