So I have tried to get ZendX_JQuery working the last hour or so (could be more) and it just wouldn’t work.
I googled all over the place. Read blogs, wikis, the Zend Referance guide, stackoverflow questions and forums. They all say to do the same thing:
Put this in your layout:
$this->jQuery();
and this:
$view = new ZendView();
$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendXJQueryViewHelper');
$viewRenderer = new ZendControllerActionHelperViewRenderer();
$viewRenderer->setView($view);
ZendControllerAction_HelperBroker::addHelper($viewRenderer);
in the bootstrap.php.
The problem is that it work on the views where I use jQuery, but on the others I get a long error message. Here, share the pain with me:
“Fatal error: Uncaught exception ‘ZendLoaderPluginLoaderException’ with message ‘Plugin by name ‘JQuery’ was not found in the registry; used paths: ZendViewHelper: Zend/View/Helper/:./views/helpers/’ in /opt/lampp/htdocs/mjfregistration/library/Zend/Loader/PluginLoader.php:412 Stack trace: #0 /opt/lampp/htdocs/mjfregistration/library/Zend/View/Abstract.php(1170): ZendLoaderPluginLoader->load(‘JQuery’) #1 /opt/lampp/htdocs/mjfregistration/library/Zend/View/Abstract.php(610): ZendViewAbstract->getPlugin(‘helper’, ‘jQuery’) #2 /opt/lampp/htdocs/mjfregistration/library/Zend/View/Abstract.php(336): ZendViewAbstract->getHelper(‘jQuery’) #3 [internal function]: ZendView_Abstract->__call(‘jQuery’, Array) #4 /opt/lampp/htdocs/mjfregistration/application/layouts/scripts/layout.phtml(8): Zend_View->jQuery() #5 /opt/lampp/htdocs/mjfregistration/library/Zend/View.php(108): include(‘/opt/lampp/htdo…’) #6 /opt/lampp/htdocs/mjfregistration/library/Zend/View/Abstract.php(880): Zend_View->_run(‘/opt/lampp/htdo…’) #7 /opt/l in /opt/lampp/htdocs/mjfregistration/library/Zend/Loader/PluginLoader.php on line 412″
So finally I find this video and in it the code that actually works
$this->bootstrap("layout");
$layout = $this->getResource("layout");
$view = $layout->getView();
ZendX_JQuery::enableView($view);
I’m not sure why the thing that every other tutorial and blog says to do didn’t work, but this did, so at this point I’m happy:D

