|
- <?php
-
- /**
- * 新UIAsset,MenuAsset是偏旧一点的样式,css都在项目内,
- * 这个UIAsset都加载线上css
- * 作为所有新项目的样式
- *
- */
-
- namespace backend\assets;
-
- use yii\web\AssetBundle;
- use yii\web\AssetManager;
- use yii\web\View;
-
- class UIAsset extends AssetBundle
- {
- public $sourcePath = '@backend/assets';
-
- public $css = [
- 'http://img.zhizhuchuxing.cn/zzframe/dist/css/bootstrap.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/style.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/bootstrap-datetimepicker.css',
- 'http://img.zhizhuchuxing.cn/zzframe/docs/assets/css/docs.min.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/home.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/prettify.min.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/module.css',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/css/xcConfirm.css',
-
- 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.css',
-
- 'global/css/ui.css?version=3.0.6',
- 'zzcx/css/loader.css'
- ];
- public $js = [
- 'http://img.zhizhuchuxing.cn/zzframe/dists/js/bootstrap-datetimepicker.min.js',
- 'global/scripts/jquery.cookie.js?v0421',
- // 'global/scripts/bootstrap.min.js?v0421',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/js/module.js',
- 'global/plugins/bootbox/bootbox.min.js',
- 'global/plugins/bootstrap-toastr/toastr.min.js',
- 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.js',
- 'http://img.zhizhuchuxing.cn/zzframe/dists/js/xcConfirm.js',
- 'zzcx/js/common.js?version=1.0',
- 'zzcx/js/zzcx.js?version=3.0.7',
-
- ];
-
- public $depends = [
- 'yii\web\YiiAsset',
- 'yii\bootstrap\BootstrapPluginAsset',
- ];
-
- public $publishOptions = [
- 'forceCopy' => true,
- // you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG
- ];
-
- /**
- * 定义按需加载JS方法
- * @param $view View
- * @param $jsfile
- */
- public static function addScript($view, $jsfile)
- {
- $AssetManager = new AssetManager();
- $jsfile = $AssetManager->getPublishedUrl('@backend/assets') . $jsfile;
- $view->registerJsFile($jsfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']);
- }
-
- /**
- * 定义按需加载css方法
- * @param $view View
- * @param $jsfile
- */
- public static function addCss($view, $cssfile)
- {
- $AssetManager = new AssetManager();
- $cssfile = $AssetManager->getPublishedUrl('@backend/assets') . $cssfile;
- $view->registerCssFile($cssfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']);
- }
- }
-
- ?>
|