Yii2 - Change jQuery Version

I want to change the jQuery version of yii2. I installed yii2 through the composer. I read a similar question: Change the jQuery JqueryAsset version on a specific page

But the problem I am facing, where should I put this code? Should I post it on the watch page? But I want to change the jquery version for all pages. Is this code compatible for yii2?

+6
source share
1 answer

You can easily customize a set of jquery packages by setting assetManager in the configuration of application components (usually config/web.php ), for example, if you want to use the jquery file in the web/js folder:

  'assetManager' => [ 'bundles' => [ 'yii\web\JqueryAsset' => [ 'sourcePath' => null, 'basePath' => '@webroot', 'baseUrl' => '@web', 'js' => [ 'js/jquery.js', ] ], ], ], 

More details: http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#customizing-asset-bundles

+13
source

Source: https://habr.com/ru/post/983147/


All Articles