disable boostrap

how to disable bootstrap in yii2 advanced?

Thanks in advanced

Assuming that we are speaking of Twitter Bottstrap extension rather than the bootstrap process, it should be like this:

  • Remove all references to yii\bootstrap\* classes (widgets, asset bundles) from view templates.
  • Remove "yiisoft/yii2-bootstrap" from composer.json and run composer update.

I don’t know if core widgets like yii\grid\GridView and other preinstalled extensions like Gii depend on Bootstrap because I don’t use them.

do what @phtamas said and as far as asset bundles he means




public $depends = [

  'yii\bootstrap\BootstrapPluginAsset',#REMOVE

 'yii\bootstrap\BootstrapAsset'#REMOVE 

];

if those are all removed you won’t have to disable them like

in your main.php /components section




'assetManager' => [  

 'bundles' => [

  'yii\bootstrap\BootstrapPluginAsset' => ['js'=>[]], 

  'yii\bootstrap\BootstrapAsset' => ['css' => []]   

 ]

]



Unfortunately a lot of yii2 widgets / plugins people make depend on theses you you may have to do the above.

Thank u very much

I would create:

New AssetManager (MyNewAsset.php) like AppAsset but with the bootstrap removed (as earlier posts say)

New mymain.php layout with MyNewAsset::register($this); replacing AppAsset::register($this); (copy existing main.php)

In the your controller code:

$this->layout = ‘mymain’;

In this way any standard yii pages will still work.

  1. to not include in app add in config



		'assetManager' => [

...

			'bundles' => [

....

				'yii\bootstrap\BootstrapAsset' => [

					'sourcePath' => null, 'css' => []

				]

				

			]

		],



2.to not download bootstrap into vendor path add to your composer.json




	"replace": {

		"bower-asset/bootstrap": "*"

	},