如何在 yii 中安装引导程序扩展 [英] How to install bootstrap extension in yii

查看:22
本文介绍了如何在 yii 中安装引导程序扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Im a newbie to yii and have been trying to add bootstrap and giiplus extension to yii.However after adding the extracted file to extensions folder and making changes in main.php I cant seem to get error in displaying even the main page.I followed this tutorial..

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

推荐答案

这里下载扩展程序.

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

Paste all bootstrap extensions folders what you have download under 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',
         ),

extensions/boostrap/components/Bootstrap.php

在课堂上粘贴代码

extensions/boostrap/components/Bootstrap.php

Paste code in class

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

protected/views/layout/main.php

在 head 标签下粘贴一行

protected/views/layout/main.php

Paste the line under head tag

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

点击此链接获取文档

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

这篇关于如何在 yii 中安装引导程序扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆