I want to change the jQuery version of yii2. I've installed yii2 through composer. I've read a similar question here: Change JqueryAsset's jQuery version on certain page
But the problem I'm facing is where should I place this code? Should I place it on the view page? But I want to change the jquery version for all the pages. Is this code compatible for yii2?
You can easily customize jquery asset bundle by configuring assetManager
in the application components configuration (usually config/web.php
), for example if you want to use a jquery file in web/js
folder :
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => [
'js/jquery.js',
]
],
],
],
Read more : http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#customizing-asset-bundles
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With