views:

363

answers:

1
<ul>
    <li>
        <a href="<?= $this->route('list', 'test1', 'default', array(), null, false) ?>">Test1
        </a>
    </li>
    <li>
        <a href="<?= $this->route('list', 'test1', 'default', array(), null, false) ?>">Test2
        </a>
    </li>
    <li>
        <a href="<?= $this->route('list', 'test3', 'default', array(), null, false) ?>">Test3
        </a>
    </li>

I hav the above html in navigation.phtml

Irender this as my menu . How can i use zend navigation from the above phtml ?

Pls help,

Regards Nisanth

A: 

Hi Nisanth,

I just happened to do a blog post on using Zend Navigation. Basically, it's a three step process:

  1. Add configuration entries for navigation in the application.ini file.

  2. Initialise and attach an instance of the Zend_Navigation container class to the navigation helper via the view in the bootstrap.

  3. Display the navigation bar with Zend_View_Helper_Navigation::menu() or the BreadCrumbs with Zend_View_Helper_Navigation::breadcrumbs() in your layout.phtml file.

I'd copy and paste the entire blog post here, but I'm not going to. Just get the details and code samples here: http://www.rvdavid.net/zend_navigation-makes-writing-navigation-for-zf-sites-very-easy/

HTH!

rvdavid