[Solar-talk] Helpers and paths
Andreas Ravnestad
andreas.ravnestad at gmail.com
Sun Nov 12 07:05:02 PST 2006
Rodrigo Moraes wrote:
> On 11/12/06, Andreas Ravnestad wrote:
>
>> This has been discussed previously:
>> http://lists.solarphp.com/pipermail/solar-talk/2006-May/000883.html
>>
>> I'm having trouble getting Solar to discover my helpers in my vendor
>> folder. I've got this in my conf file:
>>
>> $config['Portal_App_Default']['helper_class'] = 'Indigo_View_Helper';
>>
>
> Hi Andreas,
> 'helper_class' is not a config key for Solar_App or
> Solar_Controller_Page. But you can add it to tour app class and then
> override Solar_Controller_Page::_getView(). This method is responsible
> for setting View and Helpers paths.
>
> This is what you need:
>
> protected function _getView()
> {
> // build the default view
> $view = parent::_getView()
>
> // add your helper definitions
> $view->addHelperClass($this->_config['helper_class']);
>
> // done!
> return $view;
> }
>
> Basically, if you need different paths than the defaults, you need to
> override _getView() (for views and helpers) or _setViewLayout($view)
> (for layouts).
>
Thanks alot, that did the trick :)
-Andreas
More information about the solar-talk
mailing list