I need to stop loading bootstrap.css file in one view to void duplicate. But I don’t know how to do that in Yii2.
I used this function in Yii 1:
Yii::app()->clientScript->scriptMap = array( 'main.css' => false );
Do we have like this function in yii2 ?
Do not use widgets that using bootstrap
I found solution:
If you need to disable the CSS specific to core bootstrap in a view then add the following on top of your view file like this
Yii::$app->assetManager->bundles['yii\bootstrap\BootstrapAsset'] = false;
and if you need to disable the bootstrap core js sources also then use
Yii::$app->assetManager->bundles['yii\bootstrap\BootstrapPluginAsset'] = false;
bootstrap.css was loading on a page it shouldn’t but only on first page load! On page refresh it would disappear! I could not find where it was loading from! I tried for hours! Thanks!!!