Alex Tech Adventures The webs best tutorials!

Welcome, Guest
Please Login or Register.    Lost Password?

SOLVED: Zend_Navigation multiple menus
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: SOLVED: Zend_Navigation multiple menus
#328
SOLVED: Zend_Navigation multiple menus 2 Years ago Karma: 0
UPDATE: I see this was a bug opened in ZF against 1.8.2 (zendframework.com/issues/browse/ZF-6865?...anels%3Aall-tabpanel) and was closed with WONT FIX. Guess I'll have to hack my way around it with a plugin or extended class. Thanks.

Hello. I'm still going through your tutorials which are very good.

I have a question regarding using Zend_Navigation for two menus using your code from tutorial 19. I use a navigation.xml file with a nav and nav2 sections, each with their on links. I create two containers using the named sections and it appears that the objects contain the correct pages. It looks something like this:

Code:


$navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$navContainer = new Zend_Navigation($navContainerConfig);

$navContainer2Config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav2');
$navContainer2 = new Zend_Navigation($navContainer2Config);

$view->navigation($navContainer)->setAcl($this->_acl)->setRole(Zend_Registry::get('role'));



The question I have is how I handle passing the $navContainer2 object to my layout?

I tried adding a new $view->navigation($navContainer2)... but that overwrites the first container.

Thank you for any tips.
PHPKick
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: San Diego, CA USA
Last Edit: 2010/01/16 01:02 By PHPKick.
The administrator has disabled public write access.
 
#332
Re:SOLVED: Zend_Navigation multiple menus 2 Years ago Karma: 0
The way I implemented this was as described in the Bug. In the bootstrap, I put the containers in the registry. Then in the layout I get the containers from the registry and display them in the respective areas. I also added logic to pass an array of containers so that the layout would display a stack of menus.

This made my layout look really messy so I'm still searching for a way to do this in the helper. Cheers
PHPKick
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: San Diego, CA USA
The administrator has disabled public write access.
 
#348
Re:SOLVED: Zend_Navigation multiple menus 2 Years ago Karma: 16
Looking through source of Z_Navigation view helper it appears to be doable to extend it and have a custom one. I'd love to go through it and see if I can make a mod but just not enough time
alexanderrv
Administrator
Posts: 279
graph
User Offline Click here to see the profile of this user
Gender: Male tmthv2 alexchatonly@hotmail.com Location: Freeport, Bahamas Birthdate: 1989-04-14
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: alexanderrv
You are here: Home Forum

Statistics

Members : 1388
Content : 42
Web Links : 1
Content View Hits : 190541

Poll

Interested in TinyBrowser and TinyMce plugin for ZF?
 

Who's Online

We have 26 guests online