I’m trying to include the jquery helper in my zend project, documentation from zend is kind of ambiguous, it indicates to use a few lines of code in bootstrap but there are quite some functions like _initDoctype / _initView / _initViewHelpers / _initAutoload but it doesn’t say where exactly i have to paste the provided code. I pasted it in the _initDoctype one, is that good enough???
using this line of code is ok so far:
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
when adding this line for a js file or for a simple css file the application crashes bad:
$view->jQuery()->setLocalPath($view->baseUrl . '/js/jquery-1.6.4.min.js');
$view->jQuery()->addStylesheet($view->baseUrl . '/css/smoothness/jquery-ui-1.8.16.custom.css');`
output is a blank page with the following error message:
Fatal error: Uncaught exception ‘Zend_Loader_PluginLoader_Exception’
with message ‘Plugin by name ‘JQuery’ was not found in the registry;
used paths: ZendX_JQuery_View_Helper_: ZendX/JQuery/View/Helper/
Zend_View_Helper_: Zend/View/Helper/’
so, oviously trying to add more code like
$view->jQuery()->enable();
$view->jQuery()->uiEnable();
is simply useless…
I really need this so called “helper” b/c i don’t want to load another page, but it’s taken a lot of time and every solution I found over the Web simply doesn’t work with my app, it’s frustrating… this should be something to take like 5 or 10 minutes to implement but i’ve spent HOURS on this and nothing works!
Question 1: did I choosed the wrong framework…?
I’m starting to think that the old fashion way is better (meaning creating the app with by hand with no framework at all) and focus later on security issues, some comments about this will be great.
Any help is truly appreciated.
I experienced similar issues trying to get the Zend Framework jQuery helpers set up. Refer to this S.O. answer for the solution: Best way to start using jQuery in a Zend Framework 1.9 application?
In regards to your question:
It depends. Zend Framework is not bad, but since learning Zend Framework I have discovered Ruby and the Rails framework and I love it. Ruby has a very nice, readable syntax and Rails is much easier to get started using than Zend Framework.