I have a navigation.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <nav>
        <programm_nav>
            <label></label>
            <uri>#</uri>
            <pages>
                <all>
                    <label>test1</label>
                    <resource>default:programme</resource>
                    <module>default</module>
                    <controller>programme</controller>
                    <action>list</action>
                    <privilege>index</privilege>
                </all>                      
            </pages>
        </programm_nav>
        <acc_nav>
        <label></label>
            <uri>#</uri>
            <pages>
                <ueb>
                    <label>test2</label>
                    <resource>default:account</resource>
                    <module>default</module>
                    <controller>account</controller>
                    <action>index</action>
                    <privilege>index</privilege>
                </ueb>                      
            </pages>
        </acc_nav>
    </nav>
</config>

This config file defines two navigation boxes, one programm_nav and the other acc_nav.

In my bootstrap I do the following:

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

$navContainer = new Zend_Navigation ( $navContainerConfig );

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

In my view I display the navigation:

$navSec = $this->navigation ()->findOneByLabel ( 'acc_nav' );
echo $this->navigation ()->menu ()->renderMenu ( $navSec );

But no matter how I define $navSec I always displays programm_nav and never another box. acc_nav is never displayed.

Any idea?

Accepted Answer

findOneByLabel('acc_nav'); will search for text in <label>-tags as there is nog acc_nav value. It won't find it.

Written by tom
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki