I have installed yii2-admin module, located in /vendor/mdmsoft/yii2-admin but I don't want it to load its own asset bundle. It there any way to disable this module asset bundle?
Asked
Active
Viewed 2,423 times
1 Answers
2
Yes, it's possible and even mentioned in official docs here. One way to do it is through application config:
return [
// ...
'components' => [
'assetManager' => [
'bundles' => [
'mdm\admin\AdminAsset' => false,
],
],
],
];
Another way - during runtime through component:
\Yii::$app->assetManager->bundles['mdm\admin\AdminAsset'] = false;

arogachev
- 33,150
- 7
- 114
- 117
-
No I want to dissable asset bundle of that module only. I dont want to disable 'yii\web\JqueryAsset' bundle. – Lê Sỹ Hoàng May 27 '15 at 04:05
-
Obviously I just mentioned this as an example. Replace with asset bundle you want to disable, you didn't provide any information about its namespace. – arogachev May 27 '15 at 04:10
-
My bad, its namespace is 'mdm\admin' provided in file AdminAsset.php. – Lê Sỹ Hoàng May 27 '15 at 04:14
-
Updated answer with this bundle. – arogachev May 27 '15 at 04:18