Latest Stable Version ¶
Montly Downloads Packagist ¶
Total Downloads Packagist ¶
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.
Based on what?
Is it based on some existent bootstrap2 extension? If yes then on what?
Based
Is Based on Twitter Bootstrap3 Yiistrap and can be standalone.
You have to include the bootstrap by yourself like this.
<?php /** * User: Pascal Brewing * Date: 08.09.13 * Time: 19:56 */ $cs = Yii::app()->clientScript; $themePath = Yii::app()->theme->baseUrl; /** * StyleSHeets */ $cs ->registerCssFile($themePath.'/assets/css/bootstrap.css') ->registerCssFile($themePath.'/assets/css/presentage-theme.css'); /** * JavaScripts */ //echo CGoogleApi::init(); //echo CHtml::script( // CGoogleApi::load('jquery.min','1.8.3') //); $cs ->registerCoreScript('jquery',CClientScript::POS_END) ->registerCoreScript('jquery.ui',CClientScript::POS_END) ->registerScriptFile($themePath.'/assets/js/bootstrap.min.js',CClientScript::POS_END) ->registerScriptFile($themePath.'/assets/js/holder.js',CClientScript::POS_END) ->registerScript('tooltip', "$('[data-toggle=\"tooltip\"]').tooltip(); $('[rel=\"tooltip\"]').tooltip()" ,CClientScript::POS_READY) ->registerScript( 'affix', "$('affix').affix({ offset: { top: 100 , bottom: function () { return (this.bottom = $('.bs-footer').outerHeight(true)) } } })" ,CClientScript::POS_READY); ?> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="<?php echo Yii::app()->theme->baseUrl ?>/assets/js/html5shiv.js"></script> <script src="<?php echo Yii::app()->theme->baseUrl ?>/assets/js/respond.min.js"></script> <![endif]-->
3 questions. :)
Hello,
1)
Setup, config. Ok.
Usage on the git page. Ok.
Can someone please provide the steps on how to install please?
2)
class BootStrapModule extends \CWebModule {
Is it ok the earlier \ slash?
3)
On backend.php we may see some references to Yiistrap, should we setup that first?
Btw, thanks for taking this step on integrating boostrap 3 with Yii.
Install
Hi mem,
die you see this ?
backend.php
thats a config example. Here is a complete example for this i use composer if you dont want use composer just copied it to your protected/modules.
I hope i can help you out and if there any question again tells me
greetz
ps you dont need Yiistrap or Yiiwheels or anything ...
one remaining :)
Thank you. One last question remains: On your BootStrapModule there is a \ before the extended class name (at least the common one), why is that?
Thank you again and again for proving this, and for all your time here.
why \
Thank you. One last question remains: On your BootStrapModule there is a \ before the extended class name (at least the common one), why is that?
This was an experiment with namespaces
Manuel installation
I will write a How To in 6-7 days because at the moment iam trouble
thanks. :)
I will write something about the setup while I try to do it.
If you wish, I may send you an email about the steps done, and perhaps you can write (and correct) on top of it.
@mem
http://www.php.net/manual/en/language.namespaces.rationale.php
just for PHP >= 5.3.0
;)
welcome
thanks. :) I will write something about the setup while I try to do it. If you wish, I may send you an email about the steps done, and perhaps you can write (and correct) on top of it.
@mem Yes sure
Any more detailed document
So thanks for this extension.
Is there any more details for setting it up, using in Yii applications?
Documentation
I'am work on it ...
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:
SETUP BOOTSTRAP
1)
Download Bootstrap from the official website.
1.1)
Place
boostrap.css and bootstrap-theme.css inside _/publichtml/css or similar.
Place
bootstrap.min.js inside your public js library folder _publichtml/js/ or similar.
1.2)
Setup your layout file like this:
$cs = Yii::app()->clientScript; $cs->registerCssFile('/css/bootstrap.css') ->registerCssFile('/css/bootstrap-theme.css'); $cs->registerScriptFile($baseUrl . '/js/bootstrap.min.js', CClientScript::POS_END);
SETUP YII BOOTSTRAP 3 MODULE
2)
Download Yii Module from here:
https://bitbucket.org/DrMabuse/yii-bootstrap-3-module
3)
Rename the main downloaded directory to
boostrap
and place it inside:protected/extensions/
directory. If extensions directory doesn't exist, create one.4)
Setup your config file by changing the following elements:
Aliases array:
'aliases' => array( 'bootstrap' => 'ext.bootstrap' ),
Import array:
'import' => array( 'bootstrap.*', 'bootstrap.components.*', 'bootstrap.behaviours.*', 'bootstrap.helpers.*', 'bootstrap.widgets.*' ),
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.
Installation
This points are already under Point Installation ... click on It. Next you can use composer this more usefull for developers no update trouble etc ....
Can I use bootswatch theme ?
Is is fully compatible with latest bootstrap3 bootswatch theme ?
bootswatch theme
when this on is using bootstrap3 yes you can plz read the installation
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:
generateControlGroup
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
method?
But a full class and method overwrite just to write a class... :s
BsModal?
How use BsModal with show:true??
<?php $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!!
Fix Show
@isseth23 now works,plz use next time Issue Tracker
'show' => true, //optional 'htmlOptions' => array( 'data-backdrop' => false ),
BSHtml::tabs static content
How do I specify static content for a tab?
echo BSHtml::tabs(array( array( 'label' => 'Home', 'active' => true, 'content => '<p>test</p>', ),
Renders
<li 'content'='<p>test</p>'....
content does not exist
Excellent work!
Thanks for sharing.
thx for excellent :)
welcome :)
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> </span> </div><!-- /input-group -->
input group
like this ?
> Bombero
<?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( 'system.web.widgets.captcha.CCaptcha', array(), true ) . '<br/>' ), )); ?> <?php endif; ?>>
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
Thanks
Regards
BsCaptcha
@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.
greetz
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?
Thanks
Regards
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?
Thanks.
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 ?
how to customize BsNavbar color ?
add the right css for that
Sorry i dont know to say anymore to that
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.