registerJsFile($jsfile.static::Clear(), [AppAsset::className(), "depends" => "wechat\assets\AppAsset"]); } public static function addCss($view, $jsfile) { $view->registerCssFile($jsfile.static::Clear(), [AppAsset::className(), "depends" => "wechat\assets\AppAsset"]); } public function registerAssetFiles($view) { $manager = $view->getAssetManager(); foreach ($this->js as $js) { if (is_array($js)) { $file = array_shift($js); $options = ArrayHelper::merge($this->jsOptions, $js); $view->registerJsFile($manager->getAssetUrl($this, $file), $options); } else { if ($js !== null) { $view->registerJsFile($manager->getAssetUrl($this, $js.static::Clear()), $this->jsOptions); } } } foreach ($this->css as $css) { if (is_array($css)) { $file = array_shift($css); $options = ArrayHelper::merge($this->cssOptions, $css); $view->registerCssFile($manager->getAssetUrl($this, $file), $options); } else { if ($css !== null) { $view->registerCssFile($manager->getAssetUrl($this, $css.static::Clear()), $this->cssOptions); } } } } public static function Clear() { $cache = Yii::$app->cache; $name = Yii::$app->params['resourceCacheKey']['wechat']; $con = $cache->get($name); if($con != false) { return '?v='.$con; } else { return '?v=1111001s'; } } }