flying1188
- flying1188 赞了回复
在view中这样加载js方法
<script> <?php $this->beginBlock('js_end') ?> function jsfunction() { //jscode } <?php $this->endBlock() ?> </script> <?php $this->registerJs($this->blocks['js_end'], \yii\web\View::POS_END); ?>
可以写多个block,随意放置在头部或者底部,具体位置请看
\yii\web\View
类 - flying1188 赞了回复
Yii2 中默认已经配置好 Bootstrap了,不用额外配置。
配置的位置在app/assets/AppAsset.php
- flying1188 赞了回答
你想要写好bootstrap,可以到这里去学习:http://v3.bootcss.com
你写的称为栅格系统,自从升到 bootstrap v3 版本已经不支持
span*
的写法了,取而代之的是用类似.col-xs-*
、col-md-*
这种预定义的类,来快速创建栅格布局。比如,你应该将
row-fluid
改为row
,并且将span4
改为col-md-4
,span8
改为col-md-8