true, // you can also make it work only in debug mode: 'forceCopy' => YII_DEBUG ]; /** * 定义按需加载JS方法 * @param $view View * @param $jsfile */ public static function addScript($view, $jsfile) { $AssetManager = new AssetManager(); $jsfile = $AssetManager->getPublishedUrl('@backend/assets') . $jsfile; $view->registerJsFile($jsfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']); } /** * 定义按需加载css方法 * @param $view View * @param $jsfile */ public static function addCss($view, $cssfile) { $AssetManager = new AssetManager(); $cssfile = $AssetManager->getPublishedUrl('@backend/assets') . $cssfile; $view->registerCssFile($cssfile, [MenuAsset::className(), 'depends' => 'backend\assets\UIAsset']); } } ?>