$this->registerCssFile("http://example.com/css/themes/black-and-white.css", [BootstrapAsset::className()], ['media'=>'print'],'css-print-theme'); 还可以设置其它项: $this->registerLinkTag([ 'title'=>'Lives News for Yii Framework', 'rel'=>'alternate', 'type'=>'application/rss+xml', 'href'=>'http://www.yiiframework.com/rss.xml/', ]); $this->registerMetaTag(['encoding'=>'utf-8']); $this->registerJsFile('http://example.com/js/main.js', [JqueryAsset::className()]);