我想更改yii2的jQuery版本。我已经通过作曲家安装了yii2。我在这里读过类似的问题:Change JqueryAsset's jQuery version on certain page
但是我面临的问题是该代码应该放在哪里?我应该将其放置在查看页面上吗?但是我想更改所有页面的jQuery版本。该代码与yii2兼容吗?
例如,如果您想在assetManager
文件夹中使用jquery文件,则可以通过在应用程序组件配置中配置config/web.php
(通常为web/js
)来轻松定制jquery资产捆绑包:>
'assetManager' => [ 'bundles' => [ 'yii\web\JqueryAsset' => [ 'sourcePath' => null, 'basePath' => '@webroot', 'baseUrl' => '@web', 'js' => [ 'js/jquery.js', ] ], ], ],
阅读更多:http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#customizing-asset-bundles
通过作曲家解决方案