config:
resources.frontController.plugins.nav = "WD_Controller_Plugin_Nav"
bootstrap:
protected function _initAutoloader() {
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('WD_');
return $loader;
}
protected function _initNav() {
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Xml( APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$navigation = Zend_Navigation( $config );
$fc = Zend_Controller_Front::getInstance();
$fc->registerPlugin( new WD_Controller_Plugin_Nav() );
$view->navigation( $navigation );
}
library/WD/Controller/Plugin/Nav.php:
class WD_Controller_Plugin_Nav extends Zend_Controller_Plugin_Abstract {
public function postDispatch() {
$uri = $this->_request->getPathInfo();
$view = Zend_Layout::getMvcInstance()->getView();
$activeNav = $view->navigation()->findByUri($uri)->setActive(true);
}
}
web output:
Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'FindByUri' was not found in the registry
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.