2011-02-23 70 views
1

我的jQuery中的application.ini以下设置,因为它在每一个控制器和每一个动作使用:如何将ZendX_JQuery切换回使用CDN而不是本地库?

[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" 

我不想使用CDN的发展,因为它可能是缓慢的,有时是因为我在代理之后。然而,在一种情况下,我想使用CDN,因为基本URI必须不同。

下面确实为核心库的伎俩:

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

但它不会对UI库工作:

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

任何想法?

回答

0

你可以试试,如果这个工程

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

我不知道它怎么可能帮助。 jQuery配置为全局使用本地库,但我需要在一个动作中使用CDN。 – yarson 2011-02-23 17:21:50

相关问题