2009年10月27日星期二

Re: [fw-mvc] Custom Zend_Helper_Navigation_* helper

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
>

--
View this message in context: http://www.nabble.com/Custom-Zend_Helper_Navigation_*-helper-tp26081193p26081213.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: