【发布时间】:2012-11-08 09:34:44
【问题描述】:
我是 yii 的新手,一直在尝试向 yii 添加 bootstrap 和 giiplus 扩展。但是,在将提取的文件添加到扩展文件夹并在 main.php 中进行更改后,我似乎在显示主页时都不会出错。我按照本教程进行操作..
【问题讨论】:
-
在我使用 gii 在 yii 中使用引导生成器后,错误来自 CActiveForm。
标签: yii
我是 yii 的新手,一直在尝试向 yii 添加 bootstrap 和 giiplus 扩展。但是,在将提取的文件添加到扩展文件夹并在 main.php 中进行更改后,我似乎在显示主页时都不会出错。我按照本教程进行操作..
【问题讨论】:
标签: yii
从here下载扩展。
粘贴您在 extensions/bootstrap 下下载的所有引导扩展文件夹
在数组开始之前添加
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
在返回数组下添加
'theme'=>'bootstrap',
'模块'=>数组(
'gii'=>数组(
'generatorPaths'=>数组(
'bootstrap.gii',
),
),
),
在组件下添加
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
在类中粘贴代码
public function init() {
$this->registerAllCss();
$this->registerJs();
parent::init();
}
在head标签下粘贴行
<?php echo Yii::app()->bootstrap->init();?>
【讨论】:
'theme'=>'bootstrap', 'modules'=>array('gii'=>array('generatorPaths'=>array('bootstrap.gii', ), ) , ),