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