简体   繁体   中英

How to install bootstrap extension in yii

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

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

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

Follow this link for documentation

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM