$view->navigation() is a view helper function, not a variable so you cannot just say navigatin2 unless you write a view helper plugin called that.
ZF does not support multiple navigations as discussed
here
There is a workaround suggested in comment "24/Aug/09 06:17 AM". It involves not assigning navigation to view at bootstrap (and thus not being able to add more late) but instead put Z_Nav objects in Z_Registry and then have the navigation view helper in layout render the navigation based on the Z_Nav objects in Z_Registry.
Bootstrap:
| Code: |
$navContainerConfig2 = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation2.xml', 'nav');
$navContainer2 = new Zend_Navigation($navContainerConfig2);
Zend_Registry::set('nav2', $navContainer2);
$navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$navContainer = new Zend_Navigation($navContainerConfig);
Zend_Registry::set('nav', $navContainer);
|
Layout
| Code: |
echo $this->navigation()->menu()->renderMenu(Zend_Registry::get('nav2'))->setAcl()->etc;
echo $this->navigation()->menu()->renderMenu(Zend_Registry::get('nav))->setAcl()->etc;
|