I have two plugins that both need to extend the JqueryEngineHelper.
I know that you can only specify one engine in AppController Helpers.
How can I extend the JqueryEngineHelper in both plugins? I have them both working but I cannot get them to work at the same time.
$helpers = ['Js'=>['MyPlugin.MyPluginJquery', 'MyPlugin2.MyPlugin2Jquery']];
I would like both to work, but unfortunately they do not. Only the first one is used.
Code from one of the engines
App::uses('AppHelper', 'View/Helper');
App::uses('JqueryEngineHelper', 'View/Helper');
class MrgCustomSelectJqueryEngineHelper extends JqueryEngineHelper{
function __construct(View $view, $settings = array()){
parent::__construct($view, $settings = array());
$this->_init_callbacks();
}
protected function _init_callbacks(){
$callbacks = [
'selectBoxIt'=>[]
];
$this->_callbackArguments = array_merge($this->_callbackArguments, $callbacks);
}
public function selectBoxIt($options = []){
$template = '%s.selectBoxIt({%s});';
return $this->_methodTemplate('selectBoxIt', $template, $options);
}
}
I think you're going to have to alter the plugins so that they don't conflict. Depending on how the plugins work, there may be different ways you can go about this: