I have the following settings f开发者_JAVA技巧or 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?
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);
精彩评论