Op Friday 15 May 2009 15:11:46 schreef keith Pope:
> 2009/5/15 Vladas Diržys <[email protected]>:
> > Hi,
> > I'm trying to setup Zend_Application to use module autoloader for view
> > helpers.
> > Earlier I used to add helper path manually:
> > $view->addHelperPath('path/to/views/helpers/', 'My_View_Helper');
> > Now as Zend_Application_Module_Autoloader has this information and it is
> > correctly bootstrapped, I expect that earlier declaration is redundant.
> > But at least in my application it doesn't work as I expect.
> > $view->helperTitle(); -- produces an error from PluginLoader.
> > I'm missing something or just doing something wrong?
> > PS.: $loader->load('helperTitle', 'viewhelper'); -- works.
>
> I too was wondering why the resource autoloader adds the helpers and
> filters for the modules
>
I have bootstrap classes in my module folder according to the standard
application structure. In this classes you can add an _init function:
>_initView()
>{
> $view = Zend_Layout::getMvcInstance()
> ->getView()
> ->addHelperPath( APPLICATION_PATH . '/modules/mymodule/views/helpers',
> 'MyModule_View_Helper');
> }
For me this works fine.
Regards, Jurian
--
Jurian Sluiman
Soflomo.com