php - CakePHP JS Helper: How to set jQueryObject var outside of view? -
i using js helper in cake 1.3 , due need use jquery in noconflict mode, have set in every view:
$this->js->jqueryengine->jqueryobject = 'jquery';
i have lot of views rely on this, , i'd avoid having enter line @ top of every view needs it. tried setting jqueryobject var in app_controller.php file, did not work. i'd rather not hack core jquery_engine.php file.
is there way set jqueryobject var globally within app?
thanks!
how solved it:
i created own js engine helper (views/helpers/my_jquery_engine.php
) following code:
app::import('helper', 'jqueryengine'); class myjqueryenginehelper extends jqueryenginehelper { var $jqueryobject = 'jquery'; }
then in app_controller, say: var $helpers = array('js' => array('myjquery'));
works charm.
Comments
Post a Comment