Zend Framework启用Dojo报错:Uncaught exception ‘Zend_Loader_PluginLoader_Exception’ with message ‘Plugin by name ‘Dojo’

在Zend Framework中开启Dojo时,报如下错误:
[php]
Fatal error: Uncaught exception ‘Zend_Loader_PluginLoader_Exception’ with message ‘Plugin by name ‘Dojo’ in E:\mydev\source\ZendFramework-1.12.3-minimal\library\Zend\Controller\Plugin\Broker.php on line 336
Zend_Loader_PluginLoader_Exception: Plugin by name ‘Dojo’ was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;./views\helpers/ in E:\mydev\source\ZendFramework-1.12.3-minimal\library\Zend\Loader\PluginLoader.php on line 412
[/php]
经过多次尝试,终于找到原因。在Bootstrap中,本来是这样写的:
[php]
$view->addHelperPath(‘Zend/Dojo/View/Helper/’, ‘Zend_Dojo_View_Helper’);
Zend_Dojo::enableView($view);
// $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(‘ViewRenderer’);
// $viewRenderer->setView($view);
[/php]
错误就出在上面注释的两行代码,将其注释掉即可解决。



发表评论

邮箱地址不会被公开。