Commits

David Lukas committed 0ae1b70

Navigation view helper - wip

  • Participants
  • Parent commits c71333b

Comments (0)

Files changed (1)

         $app      = $e->getParam('application');
         $locator  = $app->getLocator();
 
-        //Store renderer as a property, it will be used by the onRoute() method
+        //Store objects from locator which will be needed later
         $this->renderer         = $locator->get('Zend\View\Renderer\PhpRenderer');
         $this->navbarContainer  = $locator->get('dlutwb-nav-menu-main');
 
     public function onRoute(\Zend\Mvc\MvcEvent $e) {
         $routeMatch      = $e->getRouteMatch();
         $this->renderer->plugin('url')->setRouteMatch($routeMatch);
+        //Inject the routeMatch into every MVC page, otherwise marking pages as active does not work
         $ri = new \RecursiveIteratorIterator($this->navbarContainer, \RecursiveIteratorIterator::SELF_FIRST);
         foreach ($ri as $page) {
             if($page instanceof \Zend\Navigation\Page\Mvc) {