Zend Framework: Setup Zend Navigation


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // bootstrap.php
  2. function _initNavigation() {
  3. require_once 'configs/navigation.php';
  4. $container = new Zend_Navigation($pages);
  5.  
  6. $this->bootstrap('view');
  7. $view = $this->getResource('view');
  8. $view->navigation($container);
  9.  
  10. return $container;
  11. }
  12.  
  13. // navigation.php
  14. $pages = array(
  15. 'label' => 'Learning Zend Framework',
  16. 'controller' => 'index',
  17. 'pages' => array(
  18. 'label' => 'Home',
  19. 'controller' => 'index'
  20. ),
  21. 'label' => 'Blog',
  22. 'controller' => 'blog'
  23. ), ...
  24.  
  25. // application.ini
  26. resources.view[] =
  27.  
  28. // layout.phtml
  29. echo $this->navigation()->breadcrumbs();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.