【问题标题】:How to install bootstrap extension in yii如何在 yii 中安装引导扩展
【发布时间】:2012-11-08 09:34:44
【问题描述】:

我是 yii 的新手,一直在尝试向 yii 添加 bootstrap 和 giiplus 扩展。但是,在将提取的文件添加到扩展文件夹并在 main.php 中进行更改后,我似乎在显示主页时都不会出错。我按照本教程进行操作..

http://www.cniska.net/yii-bootstrap/setup.html

【问题讨论】:

  • 在我使用 gii 在 yii 中使用引导生成器后,错误来自 CActiveForm。

标签: yii


【解决方案1】:

here下载扩展。

粘贴您在 extensions/bootstrap 下下载的所有引导扩展文件夹

config/main.php

在数组开始之前添加 Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

在返回数组下添加

'theme'=>'bootstrap',
    '模块'=>数组(
        'gii'=>数组(
            'generatorPaths'=>数组(
                'bootstrap.gii',
            ),
        ),
    ),

在组件下添加

        'bootstrap'=>array(
        'class'=>'bootstrap.components.Bootstrap',
         ),

extensions/boostrap/components/Bootstrap.php

在类中粘贴代码

public function init() {
    $this->registerAllCss();
    $this->registerJs();
    parent::init();
}

protected/views/layout/main.php

在head标签下粘贴行

<?php echo Yii::app()->bootstrap->init();?>

点击此链接获取文档

http://www.cniska.net/yii-bootstrap/

【讨论】:

  • 'theme'=>'bootstrap', 'modules'=>array('gii'=>array('generatorPaths'=>array('bootstrap.gii', ), ) , ), 
  • 'theme' => 'bootstrap', 'modules' => array('gii' => array('class' => 'system.gii.GiiModule', 'password' => ' admin', 'generatorPaths' => 数组('bootstrap.gii', ), ), ),
猜你喜欢
  • 1970-01-01
  • 2015-07-21
  • 1970-01-01
  • 2014-09-01
  • 2010-12-06
  • 2016-01-14
  • 1970-01-01
  • 1970-01-01
  • 2016-09-28
相关资源
最近更新 更多