[Solar-talk] template path stack

Paul M Jones pmjones at solarphp.com
Wed Aug 30 08:08:20 PDT 2006


On Aug 30, 2006, at 6:21 AM, Jeff Surgeson wrote:

> Is it correct to use the same method to add to the template path  
> stack as with
> the helper class stack?

Not only is it correct, it is the One True Way.  ;-)


> public function _getView()
> {
>         $stack = array('Vendor/App/View');
>         $view = parent::_getView();
>         $view->addTemplatePath($stack);
>         return $view;
> }
>
> If you are thinking but Solar adds Vendor_App_View and
> Vendor_App_Example_View,

I was, in fact.  :-)


> correct but I find that I need to load templates from:
>
> Vendor1_App_View
> Vendor2_App_View
>
> And if my front controller is run from Vendor1 Solar will only load
>
> Vendor1_App_View
> Solar_App_view
>
> Overiding the _getView() method adds the template path from Vendor2  
> ok, but is
> it ok to do it like this or should I avoid having to load from more  
> than one
> Vendor path?

I see nothing wrong with that approach.




--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.   <http://solarphp.com>

Savant: The simple, elegant, and powerful solution for
templates in PHP.   <http://phpsavant.com>




More information about the solar-talk mailing list