While working with Yii2, I am facing a problem with jquery files.
In layout I have registered a jquery-1.10.2.min.js
file. But in inner page
as use ActiveForm
then it includes jquery file from assets as well.
Is there any way to remove jquery-1.10.2.min.js
on any page while using ActiveForm
?
Many Thanks,
M.
Yes, you should modify assetManager component config :
return [
// ...
'components' => [
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null, // do not publish the bundle
'js' => [
'//code.jquery.com/jquery-1.10.2.min.js', // use custom jquery
]
],
],
],
],
];
It will load a custom jquery (no need to register it).
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