Create a new file in the /application/configs directory called navigation.xml. Here is the content:
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
    <nav>
        <content>
            <label>Content Index</label>
            <controller>content</controller>
            <action>index</action>
            <pages>
                <page1>
                    <label>Page 1</label>
                    <controller>content</controller>
                    <action>page1</action>
                </page1>
                <page2>
                    <label>Page 2</label>
                    <controller>content</controller>
                    <action>page2</action>
                </page2>
                <page3>
                    <label>Page 3</label>
                    <controller>content</controller>
                    <action>page3</action>
                </page3>
                <page4>
                    <label>Page 4</label>
                    <controller>content</controller>
                    <action>page4</action>
                </page4>
                <page5>
                    <label>Page 5</label>
                    <controller>content</controller>
                    <action>page5</action>
                </page5>
            </pages>
        </content>
    </nav>
</configdata>Here is the method you will want to add to initialize your navigation:
protected function _initNavigation()
{
    // read in the xml menu
    $xml = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
    // initialize the navigation object with the xml
    $container = new Zend_Navigation($xml);
    // Set the navigation object to the view
    $view = Zend_Layout::getMvcInstance()->getView();
    $view->navigation($container);
}<?php
    echo $this->navigation()->menu();
?>phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1<div id="Header">
    MySite:
    <?php
        echo $this->navigation()->breadcrumbs()->setMinDepth(0)->render();
    ?>
</div> 
No comments:
Post a Comment