您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MyAssetBundle.php 520B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace common\components;
  8. use yii\web\AssetBundle;
  9. use yii ;
  10. /**
  11. * @author Qiang Xue <qiang.xue@gmail.com>
  12. * @since 2.0
  13. */
  14. class MyAssetBundle extends AssetBundle
  15. {
  16. public $sourcePath = '@app/web/' ;
  17. public function addAsset($type, $path)
  18. {
  19. $this->$type[] = $path.'?v='.filemtime(Yii::getAlias($this->sourcePath.'/'.$path)) ;
  20. }
  21. }