Set up Yii-Bootstrap in Yii Framework


Download the latest release from Yii extensions by following the link below:

http://www.yiiframework.com/extension/bootstrap/

Unzip the extension under protected/extensions/bootstrap and modify your application configuration accordingly:

If you wish to use the provided Bootstrap theme copy the theme directory to your themes directory.

 

// Define a path alias for the Bootstrap extension as it's used internally.
// In this example we assume that you unzipped the extension under protected/extensions.
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

return array(
    'theme'=>'bootstrap', // requires you to copy the theme under your themes directory
    'modules'=>array(
        'gii'=>array(
            'generatorPaths'=>array(
                'bootstrap.gii',
            ),
        ),
    ),
    'components'=>array(
        'bootstrap'=>array(
            'class'=>'bootstrap.components.Bootstrap',
        ),
    ),
);

3 thoughts on “Set up Yii-Bootstrap in Yii Framework

  1. i have use this code but it give CException like: Property “CWebApplication.0” is not defined.
    how to solve this exception..please give me replay…as soon as you can..

  2. This is not work ..

    ERROR

    Property “CWebApplication.bootstrap” is not defined.

    C:\xampp\htdocs\yii\framework\base\CModule.php(105)

    093 /**
    094 * Getter magic method.
    095 * This method is overridden to support accessing application components
    096 * like reading module properties.
    097 * @param string $name application component or property name
    098 * @return mixed the named property value
    099 */
    100 public function __get($name)
    101 {
    102 if($this->hasComponent($name))
    103 return $this->getComponent($name);
    104 else
    105 return parent::__get($name);
    106 }
    107

Leave a comment