YII2注册js、css到assets资源管理中
YII2注册js、css到assets资源管理中视图:
use app\assets\AppAsset;
AppAsset::register($this);
$baseUrl = $this->assetBundles->baseUrl . '/';
//echo $baseUrl;exit;
小部件
$view = $this->getView();
AppAsset::register($view);
$baseUrl = $view->assetBundles->baseUrl;
页:
[1]