تغییر ورژن jquery پیش فرض bootstrap در Yii2
یکی از سوالات متداول در استفاده از قالب پیش فرض Yii2 تغییر ورژن پیش فرض جی کوئری قالب می باشد
برای تغییر جی کوئری و یا اسکریپت های پیش فرضی که لود میشه
به این صورت است که شما در قسمت config باید با استفاده از assetManager
فایلهای دلخواهتونو لود کنین و در صورت نیاز فایل های پیش فرض را تغییر دهید .
'assetManager' => [ 'bundles' => [ 'yii\web\JqueryAsset' => [ 'sourcePath' => null, 'js' => ['//code.jquery.com/jquery-1.11.0-beta3.min.js'] // we'll take JQuery from CDN ], 'yii\bootstrap\BootstrapPluginAsset' => [ 'sourcePath' => null, 'js' => ['/js/bootstrap.bleeding.edge.version.js'] // and use some freakin new version of bootstrap, placed in /js folder ], 'yii\bootstrap\BootstrapAsset' => [ 'sourcePath' => null, 'css' => ['css/bootstrap.min.css', 'css/bootstrap-theme.css'] // customized BS styles ], 'nodge\eauth\assets\WidgetAssetBundle' => [ 'css' => [], // and now we disable EAuth asset css, because we're planning to use our own styles. Js files remain untouched. ], ], ],
غیر فعال کردن jquery پیش فرض در Yii2
'assetManager' => [ 'bundles' => [ 'yii\web\JqueryAsset' => [ 'js'=>[] ], 'yii\bootstrap\BootstrapPluginAsset' => [ 'js'=>[] ], 'yii\bootstrap\BootstrapAsset' => [ 'css' => [], ], ], ],