I am trying to use Zend_Navigation to create a nested site menu, but
am struggling in two areas.

I have the following code in my bootstrap;

        // Set up navigation.
        $navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH .
'/configs/config.xml', 'nav');
        $navContainer = new Zend_Navigation($navContainerConfig);
        
$view->navigation($navContainer)->setAcl($this->_acl)->setRole(Zend_Registry::get('role'));
        $view->navigation()->menu()->setUlClass('nav-main');


 I have to admit I don't understand the workings of this code.
On the last line i am setting the class for the top level UL tag, but
I also need to the the ID. Is that possible.
Again on the last line what type of object is menu()?

Also how do I set the class on UL elements nested deeper in the menu?

Here is my XML config


<?xml version="1.0" encoding="UTF-8
<config>
    <nav>
        <indexHome>
            <label>Home</label>
            <controller>index</controller>
            <action>index</action>
            <class>home</class>
            <resource>index_index</resource></indexHome>
        <test>
            <label>Test</label>
            <uri>#</uri>
            <pages>

                <myTickets>
                    <label>Home</label>
                    <controller>index</controller>
                    <action>index</action>
                    <class>home</class>
                    <resource>index_index</resource>
                </myTickets>

                <allTickets>
                    <label>Home</label>
                    <controller>index</controller>
                    <action>index</action>
                    <class>home</class>
                    <resource>index_index</resource>
                </allTickets>

            </pages>
        </test>
        <indexSupport>
            <label>Support</label>
            <controller>index</controller>
            <action>index</action>
            <class>support</class>
            <resource>index_index</resource></indexSupport>
        <indexInventory>
            <label>Inventory</label>
            <controller>index</controller>
            <action>index</action>
            <class>inventory</class>
            <resource>index_index</resource></indexInventory>
        <indexChanges>
            <label>Priorities</label>
            <controller>index</controller>
            <action>index</action>
            <class>changes</class>
            <resource>index_index</resource></indexChanges>
        <indexProjects>
            <label>Projects</label>
            <controller>index</controller>
            <action>index</action>
            <class>projects</class>
            <resource>index_index</resource></indexProjects>
    </nav>
</config>

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to