How to switch ZendX_JQuery back to use CDN rather than local library?

253 views Asked by At

I have the following settings for jQuery in application.ini because it's used in every controller and every action:

[production]
pluginPaths.ZendX_Application_Resource_ = "ZendX/Application/Resource"
resources.jquery.version    = 1.5
resources.jquery.ui_enable  = true
resources.jquery.ui_version = 1.8.9

[development : production]
resources.jquery.localpath    = "/js/jquery-1.5.min.js"
resources.jquery.ui_localpath = "/js/jquery-ui-1.8.9.custom.min.js"

I don't want to use CDN in development because it might be slow sometimes because I'm behind a proxy. However in one case I want to use CDN because base URI has to be different.

The below does the trick for the Core library:

$this->view->jQuery()->setLocalPath('');

but it doesn't work for the UI library:

$this->view->jQuery()->setUiLocalPath('');

Any ideas?

1

There are 1 answers

1
mr.alex On

You could try if this works

$config = new Zend_Config_Ini( APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV );
$this->view->jQuery()->setUiLocalPath($config->resources->jquery->ui_localpath);