BootstrapAsset.php 633 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\assets;
  3. use yii\web\AssetBundle;
  4. class BootstrapAsset extends AssetBundle
  5. {
  6. //资源文件的源文件位置
  7. public $sourcePath = '@app/static/core';
  8. //当前事例引入的文件
  9. public $css = [
  10. 'css/bootstrap.min.css',
  11. ];
  12. public $js = [
  13. 'libs/bootstrap/js/bootstrap.bundle.min.js',
  14. ];
  15. public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
  16. //没有依赖
  17. public $depends = [];
  18. static function getInitCls()
  19. {
  20. static $initCls = NULL;
  21. if(!isset($initCls)) $initCls = new BootstrapAsset();
  22. return $initCls;
  23. }
  24. }