转载请注明地址 , 尊重原创哦 .
http://blog.youkuaiyun.com/banfang2013/article/details/76062086
视图中
加载 css 和 js 代码
$this->registerCss( <<< EOT_CSS
EOT_CSS
);
$this->registerJs( <<< EOT_JS
EOT_JS
);
加载 css 和 js 文件
$this->registerCssFile('@web/css/font-awesome.css',['depends'=>['backend\assets\AppAsset']]);
//$this->registerCssFile('@web/css/index-css.css');
$this->registerJsFile('@web/js/jquery-ui.custom.js',['depends'=>['backend\assets\AppAsset']]);
//$this->registerJsFile('@web/js/jquery-2.1.9.js');
//如下position是让定义CSS/JS出现的位置
//$this->registerJsFile('@web/js/jquery-ui.custom.js',['depends'=>['backend\assets\AppAsset'],'position'=>$this::POS_HEAD]);
加载 meta (descriptions keywords)
$this->registerMetaTag(array("name"=>"keywords","content"=>"xxx"));//第一种
$this->metaTags[]="<meta name='keywords' content='xxx'/>";//第二种