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

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

请您参考如下方法:

here 下载扩展.

将您下载的所有 bootstrap 扩展文件夹粘贴到 extensions/bootstrap 下

配置/main.php

在数组开始前添加 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', 
         ), 

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/


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!