--
Jurian Sluiman
Soflomo.com
> Sorry, some of my code got mangled, it should be:
>
> $view = Zend_Layout::getMvcInstance()->getView();
> $view->addHelperPath(LIBRARY_PATH . '/My/View/Helper', 'My_View_Helper');
>
> Pete
>
> petewilliams1983 wrote:
> > I'm trying to create a custom helper for rendering menus, called
> > My_View_Helper_Navigation_CustomMenu. However, I can't work out how to
> > register and use it.
> >
> > I've tried putting this in the bootstrap:
> >
> > $view = Zend_Layout::getMvcInstance()->getView();
> > // Add custom view helper path $view->addHelperPath(LIBRARY_PATH .
> > '/My/View/Helper', 'My_View_Helper');
> >
> > This works fine for normal helpers, but not for ones within
> > Zend_View_Helper_Navigation. Calling the following in a view just throws
> > an exception:
> >
> > $this->navigation()->customMenu()->render();
> >
> > Do I have to register the helper separately with
> > Zend_View_Helper_Navigation or something? If so, how do I do this?
> >
> > Thanks,
> >
> > Pete
没有评论:
发表评论