Twitter Bootstrap 3.* for Yii

Latest Stable Version Latest Stable Version

Montly Downloads Packagist Montly Downloads

Total Downloads Packagist Total Downloads

Instructions This yii module uses Twitter Bootstrap as a base. It is written for the Yii framework and requires at least PHP> = 5.3 *.The usual widgets like CGridView offered with. You could test it after installation with the gii code generator is included in the module.


Bitbucket Repo

Total 20 comments

#17445 report it
DrMabuse at 2014/06/12 06:37pm
how to customize BsNavbar color ?

add the right css for that

Sorry i dont know to say anymore to that

#17444 report it
nguyendh at 2014/06/12 05:28pm
how to customize BsNavbar color ?

I want the BsNavbar has the this color ( http://twbscolor.smarchal.com/?bd=0080ff&bh=004080&cd=ffffff&ch=00ffff ). I copied the css but the navbar is white-out. What should I do ?

#17404 report it
mem at 2014/06/04 03:21pm
BsGridView - can we change the buttons?

Is there a way to change the action buttons of BsGridView? In CGridView we have: CButtonColumn Is there any: "BsButtonColumn"?

If not, how can we make this happen?

Should it be extended?


#17136 report it
Junior - df9 at 2014/05/06 11:42pm
How to...

Hi, please, I can't find a way to do:

1 - insert a badge or any other html in the label of an item in the top nav bar: when I try to do this, the output is just the text, not the html representation, for example, instead of displaying a badge, the page shows the html code

2 - insert a form with search field in the top nav bar

Could you please advice?



#17074 report it
DrMabuse at 2014/04/30 05:51am

@Junior - df9 Feel free to create a pull request plz add it in development branch i added it to the master if the code lookings fine.


#17067 report it
Junior - df9 at 2014/04/29 08:49pm
Suggestion for widget

Hi, thanks for this excellent work!

May I suggest a widget to render the Yii Captcha? As we can use captchas in forms, it would be very useful to have a bootstraped version generated by some BsCaptcha widget.

[edit]: this widget could render the field for captcha and a hint together with the image



#17030 report it
DrMabuse at 2014/04/25 05:28pm
input group

like this ?


<?php if (CCaptcha::checkRequirements()): ?>
    <?php echo $form->textFieldControlGroup($model, 'verifyCode', array(
        'help' => 'Please enter the letters as they are shown in the image above.',
        'controlOptions' => array(
            'before' => $this->widget(
                ) . '<br/>'
    )); ?>
<?php endif; ?>>
#17029 report it
Bombero at 2014/04/25 04:52pm
input-group with button

Hi, is it possible to make input-group with button addon? like this:

<div class="input-group">
      <input type="text" class="form-control">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Go!</button>
</div><!-- /input-group -->
#17022 report it
DrMabuse at 2014/04/24 05:32pm
thx for excellent :)

welcome :)

#17021 report it
Daniel Galvan at 2014/04/24 05:09pm
Excellent work!

Thanks for sharing.

#16561 report it
DrMabuse at 2014/03/05 06:12pm
content does not exist

16224 BsHtml::tabs static content

plz read the Documentation... tabs have no attribut content.

#16224 report it
mbetel at 2014/01/31 10:24am
BSHtml::tabs static content

How do I specify static content for a tab?

echo BSHtml::tabs(array(
        'label' => 'Home',
        'active' => true,
        'content => '<p>test</p>',


<li 'content'='<p>test</p>'....
#16066 report it
DrMabuse at 2014/01/15 03:57pm
Fix Show

@isseth23 now works,plz use next time Issue Tracker

'show' => true,
'htmlOptions' => array(
    'data-backdrop' => false
#16063 report it
lisseth23 at 2014/01/15 01:20pm

How use BsModal with show:true??

$this->widget('bootstrap.widgets.BsModal', array(
    'id' => 'myModal',
    'show' => true, /*******IMPORTANT*************/
    'header' => 'Modal Heading',
    'content' => '<p>One fine body...</p>',
    'footer' => array(
        BSHtml::button('Save Changes', array(
            'data-dismiss' => 'modal',
            'color' => BSHtml::BUTTON_COLOR_PRIMARY
        BSHtml::button('Close', array(
            'data-dismiss' => 'modal'

No work!!

#15848 report it
mem at 2013/12/22 09:14am
Adding a class to all generated textareas

@DocSnyder: What would be a proper way to add, to all textareas generated, a given css class? I wish all textareas to have a wysiwyg editor. However, since the editor doesn't support a general "textarea" and demands a class on those textareas, I tough I could do this the other way around.

I see a static call here:


return "BSHtml::activeTextAreaControlGroup(\$model,'{$column->name}',array('rows'=>6))";

But perhaps a better option would be, to leave the generator alone, and on the display time, add the css class? Like, extending the BShtml class, and overwrite



But a full class and method overwrite just to write a class... :s

#15802 report it
DrMabuse at 2013/12/18 01:01pm
bootswatch theme

when this on is using bootstrap3 yes you can plz read the installation

#15800 report it
realtebo at 2013/12/18 08:40am
Can I use bootswatch theme ?

Is is fully compatible with latest bootstrap3 bootswatch theme ?

#15710 report it
DrMabuse at 2013/12/09 03:35am

This points are already under Point Installation ... click on It. Next you can use composer this more usefull for developers no update trouble etc ....

#15688 report it
mem at 2013/12/08 11:19am
As promised - A step by step guide

Thanks DocSnyder, again, for this amaizing work. Since the bootstrap is now working as an extension, here's an update:


Download Bootstrap from the official website.

Place boostrap.css and bootstrap-theme.css inside /public_html/css or similar.
Place bootstrap.min.js inside your public js library folder public_html/js/ or similar.

Setup your layout file like this:

$cs = Yii::app()->clientScript;
$cs->registerScriptFile($baseUrl . '/js/bootstrap.min.js', CClientScript::POS_END);


Download Yii Module from here: https://bitbucket.org/DrMabuse/yii-bootstrap-3-module

Rename the main downloaded directory to boostrap and place it inside: protected/extensions/ directory. If extensions directory doesn't exist, create one.

Setup your config file by changing the following elements:

Aliases array:

'aliases' => array(
        'bootstrap' => 'ext.bootstrap'

Import array:

'import' => array(

Actions for gii module:

'modules' => array(
        'gii' => array(
            'class' => array('boostrap.gii')

Components array:

'components' => array(
        //boostrap 4 of 4 specific components
        'boostrap' => array(
            'class'=> 'boostrap.components.BsApi'

All done.

Take a look here in order to see more info: http://bootstrap3.pascal-brewing.de/site/components

Again, while the information is available on the official website, I thing a document like this is easier to follow, if you wish to do it by hand.

If something is missing or erroneous, please, let me know. Cheers.

#15078 report it
DrMabuse at 2013/10/05 05:11am

Any more detailed document So thanks for this extension. Is there any more details for setting it up, using in Yii applications?

I'am work on it ...

Leave a comment

Please to leave your comment.

Create extension
No downloadable files yet