Issue
I really need to extend Zend_View_Helper_Navigation_Menu for my custom behaviour of its methods. I use modules if it's important for you to know.
Some solutions
- How do I extend the Zend Navigation Menu View Helper?
- http://forums.zend.com/viewtopic.php?f=69&t=5594
- http://www.virgentech.com/blog/2011/05/extending-navigation-view-helpers-zend-framework.html
My problem
I've implemented all the solutions, their combinations and it still ends in failure... Guys, I am waiting for ANY hints.
Edit: The problem is that nothing happens. The standard helper is used (which works fine).
My code
My Bootstrap.php file:
protected function _initNavigation() {
$this->bootstrap('view');
$view = $this->getResource('view');
$view->addHelperPath('/../library/Application/View/Helper/Navigation', 'Application_View_Helper_');
$view->navigation($this->doGetNavigation());
}
My Application_View_Helper_Navigation_Menu
class (ROOT/library/Application/View/Helper/Navigation):
class Application_View_Helper_Navigation_Menu extends Zend_View_Helper_Navigation_Menu
{
public function menu(Zend_Navigation_Container $container = null)
{
echo 'Application_View_Helper_Navigation_Menu::menu(...)';
return parent::menu($container);
}
}
My Zend_Debug::dump($this->getHelperPaths())
calling on view:
array (size=3)
'Zend_View_Helper_' =>
array (size=1)
0 => string 'Zend/View/Helper/' (length=17)
'Application_View_Helper_' =>
array (size=1)
0 => string '/../library/Application/View/Helper/Navigation/' (length=47)
'Fleet_View_Helper_' =>
array (size=1)
0 => string 'C:/repos/statistics/trunk/application/modules/fleet/views\helpers/' (length=70)
My script view:
echo $this->navigation()->menu();