Advertisement
Guest User

Untitled

a guest
Sep 13th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Module.php
  2.  
  3. public function getServiceConfig()
  4. {
  5. return array(
  6. 'factories' => array(
  7. 'navigation' => function($sm) {
  8. return new \ModuleNamespace\Model\Navigation();
  9. }
  10. )
  11. );
  12. }
  13.  
  14. ModuleNamespace\Model;
  15.  
  16. class Navigation extends \Zend\Navigation\Navigation
  17. {
  18. public function __construct()
  19. {
  20. $home = new \Zend\Navigation\Page\Mvc();
  21.  
  22. $home->setLabel('Home')
  23. ->setController('index')
  24. ->setAction('index');
  25.  
  26. $this->addPage($home);
  27.  
  28.  
  29. $contact = new \Zend\Navigation\Page\Mvc();
  30.  
  31. $contact->setLabel('Contact')
  32. ->setController('contact')
  33. ->setAction('index');
  34.  
  35. $this->addPage($contact);
  36. }
  37. }
  38.  
  39. layout.phtml
  40.  
  41. <?php echo $this->navigation('navigation')
  42. ->menu()
  43. ->setMaxDepth(0)
  44. ->setRenderInvisible(false) ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement