作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 yii 的新手,一直在尝试向 yii 添加 bootstrap 和 giiplus 扩展。但是在将提取的文件添加到扩展文件夹并在 main.php 中进行更改后,我似乎无法在显示主页时出错。我遵循了本教程..
最佳答案
从 here 下载扩展.
将您下载的所有 bootstrap 扩展文件夹粘贴到 extensions/bootstrap 下
在数组开始前添加 Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
在返回数组下添加
'theme'=>'bootstrap', 'modules'=>array( 'gii'=>array( 'generatorPaths'=>array( 'bootstrap.gii', ), ), ),
Add in under components
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
在类中粘贴代码
public function init() {
$this->registerAllCss();
$this->registerJs();
parent::init();
}
将这行粘贴到 head 标签下
<?php echo Yii::app()->bootstrap->init();?>
关于yii - 如何在 yii 中安装 bootstrap 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13286239/
我是一名优秀的程序员,十分优秀!