如何将 ZendX_JQuery 切换回使用 CDN 而不是本地库?
我在 application.ini 中有以下 jQuery 设置,因为它在每个控制器和每个操作中都使用:
[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 必须不同。
下面的技巧适用于 Core 库:
$this->view->jQuery()->setLocalPath('');
但它不适用于 UI 库:
$this->view->jQuery()->setUiLocalPath('');
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试一下是否有效
You could try if this works