You are not logged in.
Pages: 1
Hi!
I'm trying to setup a jquery view helper. Code is as follows:
Bootstrap.php
protected function _initLayoutt(){
$config = &$this->registry->config->resources->view;
$view = new Zend_View();
$view->strictVars($config->strictVars);
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset='.$view->getEncoding());
$view->headTitle($config->headtitle);
$view->headTitle()->setSeparator($config->headseperator);
//JQuery support
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$view->JQuery() ->addStylesheet('/css/custom-theme/jquery-ui.custom.css')
->setLocalPath('/js/jquery.min.js')
->setUiLocalPath('/js/jquery-ui.custom.min.js')
->enable()
->uiEnable();
return $view;
}
I cannot access jquery() method from the view scripts, controllers or layout scripts. I get error msg:
Zend_Loader_PluginLoader_Exception: Plugin by name 'JQuery' was not found in the registry
ZendX namespace is in include path.
Can someone please point me in the right dorection ... Thanks!
Offline
hi Mihat,
I'm posting a video on zendx_jquery today!
Offline
Hi!
Thanks for your vid! I prefer jquery helpers to be set up in bootstrap since I use them a lot.
I found the error in my code with a help on zend forum.
I didn't use _initView() function so the view object was not fully set up.
Is there a list of init functions we can use? I thought that init function names are optional as long as there is "_init" prefix?
Offline
Please post your final working code. I also need this.
Offline
Pages: 1