admin 发表于 2015-7-9 10:36:27

Yii2 在view里加css

Yii2 在view里加css
$this->registerCssFile("http://example.com/css/themes/black-and-white.css",
, ['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',
);
页: [1]
查看完整版本: Yii2 在view里加css