我是yii的新手并且一直在尝试向yii添加bootstrap和giiplus扩展.但是在将提取的文件添加到扩展文件夹并在main.php中进行更改之后我甚至无法在显示主页面时出现错误.我跟着这个教程..
从这里下载扩展.
粘贴所有bootstrap扩展文件夹,在extensions/bootstrap下下载
在开始数组之前添加
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
在返回数组下添加
'theme'=>'bootstrap',
'modules'=>array(
'gii'=>array(
'generatorPaths'=>array(
'bootstrap.gii',
),
),
),
在组件下添加
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
Run Code Online (Sandbox Code Playgroud)
在课堂上粘贴代码
public function init() {
$this->registerAllCss();
$this->registerJs();
parent::init();
}
Run Code Online (Sandbox Code Playgroud)
将行粘贴在head标记下
<?php echo Yii::app()->bootstrap->init();?>
Run Code Online (Sandbox Code Playgroud)
http://www.cniska.net/yii-bootstrap/
| 归档时间: |
|
| 查看次数: |
16701 次 |
| 最近记录: |