Code Monkey home page Code Monkey logo

yiistrap's Introduction

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' => '#',),
    ),
)); ?>

yiistrap's People

Contributors

crisu83 avatar kazuo avatar jalle19 avatar marcovtwout avatar andersonamuller avatar velosipedist avatar jayala avatar tonydspaniard avatar kachar avatar smonge avatar ryanarrindell avatar resurtm avatar maxlapko avatar kpowz avatar mnvx avatar vaidasm avatar pohnean avatar sammousa avatar paaashka avatar motin avatar a-goryachev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.