simple question.
I've got a navigation that is being rendered from the database. I want to use it in two different layouts - one for default module (layout is "page.phtml") and one for admin module (this one is "layout.phtml").
I'm setting up Zend_Navigation like this:
$structure = new Application_Model_DbTable_Pages();
$pages_ready = $structure->getPagesNavigation();
$container = new Zend_Navigation($pages_ready);
Zend_Registry::set('Zend_Navigation', $container);
And calling it like this:
<?php echo $this->navigation()->adminNav(); ?> //custom helper adminNav
Problem is - it only works in the layout.phtml file (or any admin-module view that uses this layout). In the other layout it throws
Fatal error: Uncaught exception 'Zend_Navigation_Exception' with message 'Bad method call: Unknown method Zend_Navigation::menu' in C:\wamp\www\ehu\library\Zend\Navigation\Container.php on line 358
How do I get this to work in all layouts?