zoukankan      html  css  js  c++  java
  • Yii2 AppAsset.php 和 assetManager 组件 _fei

    Yii2  AppAsset.php  和 assetManager 组件

    01) 背景:Yii2中使用了 AdminLTE 3.0.0  后框架自带的bootstrap.css 与 admin样式有冲突,需要去掉 bootstrap.css

    在 backend/config/main.php 的 components 中 添加    [ 官方资源管理 ]

            'assetManager'=>[
                'bundles' => [
                    'yiiootstrapBootstrapAsset' => [
                        'css' => [],   // 禁用 bootstrap.css
                        'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                    ],
                    'yiiootstrapBootstrapPluginAsset' => [
                        'js' => [],  // 去除 bootstrap.js
                        'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                    ],
                ]
            ]

    或者:

            'assetManager'=>[
                'bundles' => [
                    'yiiootstrapBootstrapAsset' => false,
                ]
            ]
    

      

    01-02) 扩展,在这里也可以操作 jQuery, yii.js 

                    'yiiwebYiiAsset' => [
                        'js' => [],  // 去除 yii.js
                        'sourcePath' => null,  
                    ],
    
                    'yiiwidgetsActiveFormAsset' => [
                        'js' => [],  // 去除 yii.activeForm.js
                        'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                    ],
    
                    'yiivalidatorsValidationAsset' => [
                        'js' => [],  // 去除 yii.validation.js
                        'sourcePath' => null,  // 防止在 frontend/web/asset 下生产文件
                    ],
    

      

  • 相关阅读:
    JAVA集合框架01
    java基础===>点餐系统
    java基础===>数组的应用
    java基础===>双重循环打印图形
    java基础 ===》循环结构
    JAVA基础==>witch的应用!
    选择结构!
    路由系统
    flask使用及返回值、配置文件的四种方式
    短信验证码操作
  • 原文地址:https://www.cnblogs.com/dafei4/p/11528387.html
Copyright © 2011-2022 走看看