Twitter Bootstrap for the Yii PHP framework.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets Add missing asset loader.gif (fixes #255) Apr 17, 2015
behaviors
components
form Let TbForm render button container, to follow layout options Jul 11, 2014
gii/bootstrap Fixed Gii generator not working with bs3. Jan 13, 2015
helpers Fix: mark checked button in button group as active, consistent to off… Feb 19, 2015
tests Merge pull request #274 from kPOWz/buttonDropdownButtonType Feb 11, 2015
widgets Merge pull request #308 from SamMousa/bs3-fix-issue-307 May 14, 2015
.gitignore Change how tests are bootstrapped and add new tests Jul 30, 2013
.travis.yml
Gruntfile.js Add yiistrap css and grunt for compiling less Jun 18, 2013
LICENSE.txt Add license file Jun 14, 2013
README.md Update README.md Apr 17, 2015
apigen.neon Add apigen to composer require-dev. Feb 11, 2015
codeception.yml Update codeception.yml Jul 31, 2013
composer.json
composer.lock Update composer.lock to include twbs/bootstrap 3.1.1 May 21, 2014
package.json Fix styles for grid view sorting Jun 19, 2013

README.md

Yiistrap

Build Status

Twitter Bootstrap for Yii.

NOTE!

We have re-arranged the repository for this project to make it easier for people to choose the right version. Please make sure you do the following changes if they apply to you:

  • If you are using the old bs3 branch you should switch to use the 2.0.0 tag (or 2.0.x-dev alias).
  • If you are using the old master branch you should switch to use the 1.x branch.

Installation

With Composer

The easiest way to install Yiistrap is to use Composer. Add the following to your composer.json file:

"require": {
	"crisu83/yiistrap": "2.0.x-dev"
}

Run the following command to download the extension:

php composer.phar update

Add the following to your application configuration:

.....
'components' => array(
    .....
    'bootstrap' => array(
        'class' => '\TbApi',
    ),
),
.....
'modules' => array(
    .....
    'gii' => array(
        'class' => 'system.gii.GiiModule',
        'generatorPaths' => array('vendor.crisu83.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' => '#',),
    ),
)); ?>