4

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?

Jim Simson
  • 2,774
  • 3
  • 22
  • 30
Lê Sỹ Hoàng
  • 409
  • 1
  • 3
  • 15

1 Answers1

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