在VIEW引入CSS、JS文件
外联 CSS:
<?= Html::cssFile('@web/css/ie5.css', ['condition' => 'IE 5']) ?>
generates
<!--[if IE 5]>
<link href="http://example.com/css/ie5.css" />
<![endif]-->
外联JS
<?= Html::jsFile('@web/js/main.js') ?>
generates
<script type="text/javascript" src="/basic/web/js/main.js"></script>
内联CSS
<?= Html::style('.danger { color: #f00; }') ?>
Gives you
<style>.danger { color: #f00; }</style>
内联JS
<?= Html::script('alert("Hello!");', ['defer' => true]);
Gives you
<script defer>alert("Hello!");</script>