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.

motorcadeUIAsset.php 3.3 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Steven
  5. * Date: 2017/1/3
  6. * Time: 16:07
  7. */
  8. namespace backend\modules\motorcade\assets;
  9. use backend\assets\AppAsset;
  10. use yii\web\AssetManager;
  11. use yii\web\View;
  12. class motorcadeUIAsset extends AppAsset
  13. {
  14. public $sourcePath = '@backend/assets';
  15. //public $sourcePath = '@backend/assets';
  16. public $css = [
  17. // 'global/css/components.min.css'
  18. 'http://img.zhizhuchuxing.cn/zzframe/dist/css/bootstrap.css',
  19. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/style.css',
  20. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/bootstrap-datetimepicker.css',
  21. 'http://img.zhizhuchuxing.cn/zzframe/docs/assets/css/docs.min.css',
  22. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/home.css',
  23. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/prettify.min.css',
  24. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/module.css',
  25. 'http://img.zhizhuchuxing.cn/zzframe/dists/css/xcConfirm.css',
  26. 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.css',
  27. 'global/css/ui.css?version=3.0.5',
  28. 'zzcx/css/loader.css'
  29. ];
  30. public $js = [
  31. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/bootstrap-datetimepicker.min.js',
  32. 'global/scripts/jquery.cookie.js?v0421',
  33. // 'global/scripts/bootstrap.min.js?v0421',
  34. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/module.js',
  35. 'global/plugins/bootbox/bootbox.min.js',
  36. 'global/plugins/bootstrap-toastr/toastr.min.js',
  37. 'global/plugins/bootstrap-fileinput/bootstrap-fileinput.js',
  38. 'http://img.zhizhuchuxing.cn/zzframe/dists/js/xcConfirm.js',
  39. 'zzcx/js/common.js',
  40. 'zzcx/js/zzcx.js?version=3.0.4',
  41. ];
  42. public $publishOptions = [
  43. 'forceCopy' => true,
  44. //you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG
  45. ];
  46. /**
  47. * 定义按需加载JS方法
  48. * @param $view View
  49. * @param $jsfile
  50. */
  51. public static function addScript($view, $jsfile)
  52. {
  53. $AssetManager = new AssetManager();
  54. $jsfile = $AssetManager->getPublishedUrl('@backend/modules/motorcade/assets') . $jsfile;
  55. $view->registerJsFile($jsfile, [motorcadeUIAsset::className(), 'depends' => 'backend\modules\motorcade\assets\motorcadeUIAsset']);
  56. }
  57. /**
  58. * 定义按需加载JS方法
  59. * @param $view View
  60. * @param $jsfile
  61. */
  62. public static function addScriptHTTP($view, $jsfile)
  63. {
  64. $view->registerJsFile($jsfile, [motorcadeUIAsset::className(), 'depends' => 'backend\modules\motorcade\assets\motorcadeUIAsset']);
  65. }
  66. /**
  67. * 定义按需加载JS方法
  68. * @param $view View
  69. * @param $jsfile
  70. */
  71. public static function addCssHTTP($view, $jsfile)
  72. {
  73. $view->registerCssFile($jsfile, [motorcadeUIAsset::className(), 'depends' => 'backend\modules\motorcade\assets\motorcadeUIAsset']);
  74. }
  75. /**
  76. * 定义按需加载CSS方法
  77. * @param $view View
  78. * @param $jsfile
  79. */
  80. public static function addCss($view, $cssfile)
  81. {
  82. $AssetManager = new AssetManager();
  83. $cssfile = $AssetManager->getPublishedUrl('@backend/modules/motorcade/assets') . $cssfile;
  84. $view->registerCssFile($cssfile, [motorcadeUIAsset::className(), 'depends' => 'backend\modules\motorcade\assets\motorcadeUIAsset']);
  85. }
  86. }