本文介绍了Yii2禁用供应商模块的资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经安装了yii2-admin模块,位于/vendor/mdmsoft/yii2-admin中,但是我不希望它加载自己的资产捆绑包.有什么办法可以禁用此模块资产捆绑包?
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?
推荐答案
是的,在官方文档此处.一种方法是通过应用程序配置:
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;
这篇关于Yii2禁用供应商模块的资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!