|
- <?php
-
- /**
- *
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 张帅
- * PhpStorm ZzcsAsset.php
- * Create By 2016/12/9 15:45 $
- */
- namespace backend\assets;
-
- use yii\web\AssetBundle;
- use yii\web\AssetManager;
- class MenuAsset extends AssetBundle
- {
-
- public $sourcePath = '@backend/assets';
- //public $sourcePath = '@backend/assets';
-
- public $css = [
- 'global/css/bootstrap.min.css?v0421',
- 'global/css/module.css?v0422',
- 'global/css/main.css?v0422',
- 'global/plugins/bootstrap-toastr/toastr.min.css',
- ];
- public $js = [
- 'global/scripts/jquery-2.2.4.min.js?v0421',
- 'global/scripts/jquery.cookie.js?v0421',
- 'global/scripts/highcharts.js?v0421',
- 'global/scripts/bootstrap.min.js?v0421',
- 'global/scripts/module.js?v0424',
- 'global/scripts/main.js?v0421',
- 'plug/js/layer/layer.js?v0421',
- 'global/plugins/bootbox/bootbox.min.js',
- 'global/plugins/bootstrap-toastr/toastr.min.js',
- 'zzcx/js/zzcx.js?version=3.0.1',
-
- ];
- //AppAsset::addScript($this, '/global/plugins/bootbox/bootbox.min.js');
- //AppAsset::addCss($this, '/global/plugins/bootstrap-toastr/toastr.min.css');
-
- public $depends = [
- 'yii\web\YiiAsset',
- ];
-
- // public $publishOptions = [
- // 'forceCopy' => true,
- // //you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG
- // ];
-
- //定义按需加载JS方法
- public static function addScript($view, $jsfile) {
- $AssetManager = new AssetManager();
- $jsfile = $AssetManager->getPublishedUrl('@backend/assets').$jsfile;
- $view->registerJsFile($jsfile, [MenuAsset::className(), 'depends' => 'backend\assets\MenuAsset']);
- }
-
- //定义按需加载css方法
- public static function addCss($view, $cssfile) {
- $AssetManager = new AssetManager();
- $cssfile = $AssetManager->getPublishedUrl('@backend/assets').$cssfile;
- $view->registerCssFile($cssfile, [MenuAsset::className(), 'depends' => 'backend\assets\MenuAsset']);
- }
- }
- ?>
|