|
- <?php
-
-
- namespace common\components;
-
- use yii\web\AssetBundle;
- use yii ;
-
-
- class MyAssetBundle extends AssetBundle
- {
- public $sourcePath = '@app/web/' ;
-
- public function addAsset($type, $path)
- {
- if(substr($path, 0, 4) == 'http') {
- $this->$type[] = $path ;
- }
- else {
- $this->$type[] = $path.'?v='.filemtime(Yii::getAlias($this->sourcePath.'/'.$path)) ;
- }
-
- }
- }
|