title: Zend: How can I globally set the current navigation item?
body: <h2>config:</h2>
  
  <pre><code>resources.frontController.plugins.nav = "WD_Controller_Plugin_Nav"
  </code></pre>
  
  <h2>bootstrap:</h2>
  
  <pre><code>protected function _initAutoloader() {
  $loader = Zend_Loader_Autoloader::getInstance();
  $loader-&gt;registerNamespace('WD_');
  return $loader;
  }
  
  protected function _initNav() {
    $this-&gt;bootstrap('layout');
    $layout = $this-&gt;getResource('layout');
    $view = $layout-&gt;getView();
    $config = new Zend_Config_Xml( APPLICATION_PATH . '/configs/navigation.xml', 'nav');
    $navigation = Zend_Navigation( $config );
  
    $fc = Zend_Controller_Front::getInstance();
    $fc-&gt;registerPlugin( new WD_Controller_Plugin_Nav() );
    $view-&gt;navigation( $navigation );
  }
  </code></pre>
  
  <h2>library/WD/Controller/Plugin/Nav.php:</h2>
  
  <pre><code>class WD_Controller_Plugin_Nav extends Zend_Controller_Plugin_Abstract {
  
      public function postDispatch() {
          $uri = $this-&gt;_request-&gt;getPathInfo();
              $view = Zend_Layout::getMvcInstance()-&gt;getView();
          $activeNav = $view-&gt;navigation()-&gt;findByUri($uri)-&gt;setActive(true);
      }
  }
  </code></pre>
  
  <h2>web output:</h2>
  
  <blockquote>
    <p>Uncaught exception
    'Zend_Loader_PluginLoader_Exception'
    with message 'Plugin by name
    'FindByUri' was not found in the
    registry</p>
  </blockquote>
  
  <p>I pretty much know what I'm doing wrong, in that I'm referencing the Zend View Helper Navigation and not the Navigation directly ( findByUri method exists in Zend_Navigation directly ), but I'm not sure how to properly reference it. </p>