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.
 
 
 
 
 
 

71 lines
2.5 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 张帅
  12. * PhpStorm ZzcsAsset.php
  13. * Create By 2016/12/9 15:45 $
  14. */
  15. namespace backend\assets;
  16. use yii\web\AssetBundle;
  17. use yii\web\AssetManager;
  18. class MenuAsset extends AssetBundle
  19. {
  20. public $sourcePath = '@backend/assets';
  21. //public $sourcePath = '@backend/assets';
  22. public $css = [
  23. 'global/css/bootstrap.min.css?v0421',
  24. 'global/css/module.css?v0422',
  25. 'global/css/main.css?v0422',
  26. 'global/plugins/bootstrap-toastr/toastr.min.css',
  27. ];
  28. public $js = [
  29. 'global/scripts/jquery-2.2.4.min.js?v0421',
  30. 'global/scripts/jquery.cookie.js?v0421',
  31. 'global/scripts/highcharts.js?v0421',
  32. 'global/scripts/bootstrap.min.js?v0421',
  33. 'global/scripts/module.js?v0424',
  34. 'global/scripts/main.js?v0421',
  35. 'plug/js/layer/layer.js?v0421',
  36. 'global/plugins/bootbox/bootbox.min.js',
  37. 'global/plugins/bootstrap-toastr/toastr.min.js',
  38. 'zzcx/js/zzcx.js?version=3.0.1',
  39. ];
  40. //AppAsset::addScript($this, '/global/plugins/bootbox/bootbox.min.js');
  41. //AppAsset::addCss($this, '/global/plugins/bootstrap-toastr/toastr.min.css');
  42. public $depends = [
  43. 'yii\web\YiiAsset',
  44. ];
  45. // public $publishOptions = [
  46. // 'forceCopy' => true,
  47. // //you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG
  48. // ];
  49. //定义按需加载JS方法
  50. public static function addScript($view, $jsfile) {
  51. $AssetManager = new AssetManager();
  52. $jsfile = $AssetManager->getPublishedUrl('@backend/assets').$jsfile;
  53. $view->registerJsFile($jsfile, [MenuAsset::className(), 'depends' => 'backend\assets\MenuAsset']);
  54. }
  55. //定义按需加载css方法
  56. public static function addCss($view, $cssfile) {
  57. $AssetManager = new AssetManager();
  58. $cssfile = $AssetManager->getPublishedUrl('@backend/assets').$cssfile;
  59. $view->registerCssFile($cssfile, [MenuAsset::className(), 'depends' => 'backend\assets\MenuAsset']);
  60. }
  61. }
  62. ?>