How to install bootstrap extension in yii

后端 未结 1 1718
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 01:34

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

1条回答
  •  时光说笑
    2021-01-15 02:24

    Download extension from here.

    Paste all bootstrap extensions folders what you have download under extensions/bootstrap

    config/main.php

    Add before starting of array Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

    Add under return array

    '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

    Paste code in class

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

    protected/views/layout/main.php

    Paste the line under head tag

    bootstrap->init();?>
    

    Follow this link for documentation

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

    0 讨论(0)
提交回复
热议问题