marcovtwout / yiistrap
Twitter Bootstrap for the Yii PHP framework.
Installs: 7 178
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 176
Open Issues: 0
Requires
- twbs/bootstrap: ^3.3.0
Requires (Dev)
- apigen/apigen: ~4.0
- codeception/codeception: @stable
- crisu83/yii-composer: >=1.0.0
- yiisoft/yii: >=1.1.13
README
Twitter Bootstrap for Yii.
Installation
With Composer
The easiest way to install Yiistrap is to use Composer. This is assuming your Yii project is already using Composer and the autoloader.
Run the following command to require and install the extension:
composer require marcovtwout/yiistrap ~2.0@dev
Add the following to your application configuration:
..... 'components' => array( ..... 'bootstrap' => array( 'class' => '\TbApi', ), ), ..... 'modules' => array( ..... 'gii' => array( 'class' => 'system.gii.GiiModule', 'generatorPaths' => array('vendor.marcovtwout.yiistrap.gii'), ), ), .....
Add the following line to your main layout in protected/views/layouts/main.php
to register the necessary CSS and JavaScript files:
<?php Yii::app()->bootstrap->register(); ?>
Without Composer
Follow the above steps first, but download and unzip Yiistrap instead of requiring it through Composer.
Then you also need to add the following to your application configuration:
'aliases' => array( 'yiistrap' => __DIR__ . '/relative/path/to/yiistrap', ), ..... 'import' => array( ..... 'yiistrap.behaviors.*', 'yiistrap.components.*', 'yiistrap.form.*', 'yiistrap.helpers.*', 'yiistrap.widgets.*', ), .....
Usage
Documentation not updated yet, but use the current docs as a guideline: http://www.getyiistrap.com
Use the following command to generate ApiGen documentation:
php vendor\bin\apigen generate
Note: When you use a widget, prepend a \
to the filename to use autoload it through Composer:
<?php $this->widget('\TbNav', array( 'type' => TbHtml::NAV_TYPE_TABS, 'items' => array( array('label' => 'Home', 'url' => '#', 'active' => true), array('label' => 'Profile', 'url' => '#',), array('label' => 'Messages', 'url' => '#',), ), )); ?>