[Zend] 'Plugin by name 'JQuery' was not found in the registry

Got this error while trying around with Zend.
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:Zend_View_Helper_:
Zend/View/Helper/:/public_html/staging/app/views/helpers/:/public_html/staging/app/modules/default/views/helpers/' in /public_html/staging/lib/Zend/Loader/PluginLoader.php:412
Stack trace: #0
/public_html/staging/lib/Zend/View/Abstract.php(1174): Zend_Loader_PluginLoader->load('JQuery') #1
/public_html/staging/lib/Zend/View/Abstract.php(610): Zend_View_Abstract->_getPlugin('helper', 'jQuery') #2
/public_html/staging/lib/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery') #3
/public_html/staging/app/modules/default/layouts/public.phtml(19): Zend_View_Abstract->__call('jQuery', Array) #4
in/public_html/staging/lib/Zend/Loader/PluginLoader.php on line 412


Googled around and found out that many people suggested to add the following code in the _initView function in bootstrap.

protected function _initView()
{
  ..
  $view->addHelperPath("Vapps/View/Helper/",'Vapps_View_Helper');
  $view->addHelperPath("ZendX/JQuery/View/Helper",'ZendX_JQuery_View_Helper');
  ..
}

But I find the this workaround still doesn't solve the problem, simply because the helper path is not defined.

The best way is to declare the path directly in the /application/configs/application.ini file.

resources.view.helperPath.ZendX_JQuery_View_Helper = BASE_PATH "ZendX/JQuery/View/Helper"
pluginPaths.ZendX_Application_Resource = BASE_PATH "/ZendX/Application/Resource"

Note: Make sure that your ZenX library is exist in your library. ;)



References:
[1] http://framework.zend.com/manual/en/zendx.jquery.view.html
[2] http://stackoverflow.com/questions/5288365/unable-to-initialize-jqueryzendx-and-view-helpers-in-bootstrap-phpzf-1-10-8

Comments

Popular posts from this blog

[Azure Websites PHP] Cross Domain request results in blank response page after Preflight HTTP OPTIONS

[Magento] Create Contact Form with Dynamic Recipient