You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
2.7 KiB

  1. <?php
  2. /**
  3. * 新UIAsset,MenuAsset是偏旧一点的样式,css都在项目内,
  4. * 这个UIAsset都加载线上css
  5. * 作为所有新项目的样式
  6. *
  7. */
  8. namespace backend\assets;
  9. use yii\web\AssetBundle;
  10. use yii\web\AssetManager;
  11. use yii\web\View;
  12. class UIAsset extends AssetBundle
  13. {
  14. public $sourcePath = '@backend/assets';
  15. public $css = [
  16. 'http://img.zhizhuchuxing.cn/zzframe/dist/css/bootstrap.css',
  17. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/style.css',
  18. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/bootstrap-datetimepicker.css',
  19. 'http://img.zhizhuchuxing.cn/zzframe/docs/assets/css/docs.min.css',
  20. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/home.css',
  21. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/prettify.min.css',
  22. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/module.css',
  23. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/xcConfirm.css',
  24. 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.css',
  25. 'global/css/ui.css?version=3.0.6',
  26. 'zzcx/css/loader.css'
  27. ];
  28. public $js = [
  29. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/bootstrap-datetimepicker.min.js',
  30. 'global/scripts/jquery.cookie.js?v0421',
  31. // 'global/scripts/bootstrap.min.js?v0421',
  32. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/module.js',
  33. 'global/plugins/bootbox/bootbox.min.js',
  34. 'global/plugins/bootstrap-toastr/toastr.min.js',
  35. 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.js',
  36. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/xcConfirm.js',
  37. 'zzcx/js/common.js?version=1.0',
  38. 'zzcx/js/zzcx.js?version=3.0.7',
  39. ];
  40. public $depends = [
  41. 'yii\web\YiiAsset',
  42. 'yii\bootstrap\BootstrapPluginAsset',
  43. ];
  44. public $publishOptions = [
  45. 'forceCopy' => true,
  46. // you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG
  47. ];
  48. /**
  49. * 定义按需加载JS方法
  50. * @param $view View
  51. * @param $jsfile
  52. */
  53. public static function addScript($view, $jsfile)
  54. {
  55. $AssetManager = new AssetManager();
  56. $jsfile = $AssetManager->getPublishedUrl('@backend/assets') . $jsfile;
  57. $view->registerJsFile($jsfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']);
  58. }
  59. /**
  60. * 定义按需加载css方法
  61. * @param $view View
  62. * @param $jsfile
  63. */
  64. public static function addCss($view, $cssfile)
  65. {
  66. $AssetManager = new AssetManager();
  67. $cssfile = $AssetManager->getPublishedUrl('@backend/assets') . $cssfile;
  68. $view->registerCssFile($cssfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']);
  69. }
  70. }
  71. ?>