Commit f0d6adc5 by Crisu83

changed BootButton::fn to buttonType and updated the demo

parent 1a464dbc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author Christoffer Niska <ChristofferNiska@gmail.com> * @author Christoffer Niska <ChristofferNiska@gmail.com>
* @copyright Copyright &copy; Christoffer Niska 2011- * @copyright Copyright &copy; Christoffer Niska 2011-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @version 1.0.0 * @version 0.9.11
*/ */
/** /**
...@@ -99,7 +99,7 @@ class Bootstrap extends CApplicationComponent ...@@ -99,7 +99,7 @@ class Bootstrap extends CApplicationComponent
/** /**
* Registers the Yii-specific CSS missing from Bootstrap. * Registers the Yii-specific CSS missing from Bootstrap.
* @since 1.0.0 * @since 0.9.11
*/ */
public function registerYiiCss() public function registerYiiCss()
{ {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} .input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}
.php-hl-default{color:Black;} .php-hl-default{color:Black;}
.php-hl-code{color:Gray;} .php-hl-code{color:Gray;}
.php-hl-brackets{color:Olive;} .php-hl-brackets{color:Olive;}
...@@ -150,7 +151,7 @@ section{padding-top:40px;}section a.top{display:block;text-align:right;} ...@@ -150,7 +151,7 @@ section{padding-top:40px;}section a.top{display:block;text-align:right;}
#bootCarousel .carousel{width:770px;}#bootCarousel .carousel .carousel-caption p{margin-bottom:9px;} #bootCarousel .carousel{width:770px;}#bootCarousel .carousel .carousel-caption p{margin-bottom:9px;}
#bootTypeahead input{margin-bottom:0;} #bootTypeahead input{margin-bottom:0;}
.hl-code{margin-bottom:20px;}.hl-code pre{background:#FCFCFC;border-color:#EEE transparent #EEE;font-family:"Menlo","Consolas","Courier New",Courier,mono;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} .php-hl-main,.html-hl-main,.javascript-hl-main{margin-bottom:20px;}.php-hl-main pre,.html-hl-main pre,.javascript-hl-main pre{background:#FCFCFC;border-color:#EEE transparent #EEE;font-family:"Menlo","Consolas","Courier New",Courier,mono;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
.maintenance .hero-unit{text-align:center;}.maintenance .hero-unit p{text-align:inherit;} .maintenance .hero-unit{text-align:center;}.maintenance .hero-unit p{text-align:inherit;}
......
...@@ -138,7 +138,9 @@ section { ...@@ -138,7 +138,9 @@ section {
margin-bottom: 0; margin-bottom: 0;
} }
.hl-code { .php-hl-main,
.html-hl-main,
.javascript-hl-main {
margin-bottom: 20px; margin-bottom: 20px;
pre { pre {
......
...@@ -45,7 +45,7 @@ class SiteController extends Controller ...@@ -45,7 +45,7 @@ class SiteController extends Controller
); );
$tabbable = array( $tabbable = array(
array('label'=>'Section 1', 'content'=>'<p>I\'m in Section 1.</p>'), array('label'=>'Section 1', 'content'=>'<p>I\'m in Section 1.</p>', 'active'=>true),
array('label'=>'Section 2', 'content'=>'<p>Howdy, I\'m in Section 2.</p>'), array('label'=>'Section 2', 'content'=>'<p>Howdy, I\'m in Section 2.</p>'),
array('label'=>'Section 3', 'content'=>'<p>What up girl, this is Section 3.</p>'), array('label'=>'Section 3', 'content'=>'<p>What up girl, this is Section 3.</p>'),
); );
...@@ -93,6 +93,15 @@ class SiteController extends Controller ...@@ -93,6 +93,15 @@ class SiteController extends Controller
'pagination'=>array('pageSize'=>8), 'pagination'=>array('pageSize'=>8),
)); ));
$phpLighter = new CTextHighlighter();
$phpLighter->language = 'PHP';
$jsLighter = new CTextHighlighter();
$jsLighter->language = 'JAVASCRIPT';
$htmlLighter = new CTextHighlighter();
$htmlLighter->language = 'HTML';
$this->render('index', array( $this->render('index', array(
'model'=>$model, 'model'=>$model,
'person'=>new Person(), 'person'=>new Person(),
...@@ -101,7 +110,9 @@ class SiteController extends Controller ...@@ -101,7 +110,9 @@ class SiteController extends Controller
'gridDataProvider'=>$gridDataProvider, 'gridDataProvider'=>$gridDataProvider,
'gridColumns'=>$gridColumns, 'gridColumns'=>$gridColumns,
'listDataProvider'=>$listDataProvider, 'listDataProvider'=>$listDataProvider,
'parser'=>new CMarkdownParser(), 'phpLighter'=>$phpLighter,
'jsLighter'=>$jsLighter,
'htmlLighter'=>$htmlLighter,
)); ));
} }
......
...@@ -24,19 +24,14 @@ $this->addMetaProperty('fb:app_id', Yii::app()->fb->appID); ...@@ -24,19 +24,14 @@ $this->addMetaProperty('fb:app_id', Yii::app()->fb->appID);
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php
[php]
<?php
Yii::app()->user->setFlash('success', '<strong>Well done!</strong> You successfully read this important alert message.'); Yii::app()->user->setFlash('success', '<strong>Well done!</strong> You successfully read this important alert message.');
Yii::app()->user->setFlash('info', '<strong>Heads up!</strong> This alert needs your attention, but it\'s not super important.'); Yii::app()->user->setFlash('info', '<strong>Heads up!</strong> This alert needs your attention, but it\'s not super important.');
Yii::app()->user->setFlash('warning', '<strong>Warning!</strong> Best check yo self, you\'re not looking too good.'); Yii::app()->user->setFlash('warning', '<strong>Warning!</strong> Best check yo self, you\'re not looking too good.');
Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few things up and try submitting again.'); Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few things up and try submitting again.');
?> ?>"); ?>
~~~
~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootAlert'); ?>"); ?>
[php]
<?php \$this->widget('bootstrap.widgets.BootAlert'); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -52,12 +47,9 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -52,12 +47,9 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootBreadcrumbs', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootBreadcrumbs', array(
'links'=>array('Library'=>'#', 'Data'), 'links'=>array('Library'=>'#', 'Data'),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -112,9 +104,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -112,9 +104,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootNavbar', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootNavbar', array(
'fixed'=>false, 'fixed'=>false,
'brand'=>'Project name', 'brand'=>'Project name',
'brandUrl'=>'#', 'brandUrl'=>'#',
...@@ -153,8 +143,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -153,8 +143,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
), ),
), ),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -212,9 +201,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -212,9 +201,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootMenu', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootMenu', array(
'type'=>'tabs', // '', 'tabs', 'pills' (or 'list') 'type'=>'tabs', // '', 'tabs', 'pills' (or 'list')
'stacked'=>false, // whether this is a stacked menu 'stacked'=>false, // whether this is a stacked menu
'items'=>array( 'items'=>array(
...@@ -222,8 +209,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -222,8 +209,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
array('label'=>'Profile', 'url'=>'#'), array('label'=>'Profile', 'url'=>'#'),
array('label'=>'Messages', 'url'=>'#'), array('label'=>'Messages', 'url'=>'#'),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<h3>Nav list</h3> <h3>Nav list</h3>
...@@ -247,9 +233,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -247,9 +233,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootMenu', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootMenu', array(
'type'=>'list', 'type'=>'list',
'items'=>array( 'items'=>array(
array('label'=>'LIST HEADER'), array('label'=>'LIST HEADER'),
...@@ -261,8 +245,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -261,8 +245,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
array('label'=>'Settings', 'icon'=>'cog', 'url'=>'#'), array('label'=>'Settings', 'icon'=>'cog', 'url'=>'#'),
array('label'=>'Help', 'icon'=>'flag', 'url'=>'#'), array('label'=>'Help', 'icon'=>'flag', 'url'=>'#'),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -284,9 +267,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -284,9 +267,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootTabbable', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootTabbable', array(
'type'=>'tabs', // 'tabs' or 'pills' 'type'=>'tabs', // 'tabs' or 'pills'
'tabs'=>array( 'tabs'=>array(
array('label'=>'Home', 'content'=>'Raw denim you probably haven\'t heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.', 'active'=>true), array('label'=>'Home', 'content'=>'Raw denim you probably haven\'t heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.', 'active'=>true),
...@@ -300,8 +281,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -300,8 +281,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
'shown'=>\"js:function() { console.log('Tabbable shown.'); }\", 'shown'=>\"js:function() { console.log('Tabbable shown.'); }\",
), ),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<div class="alert alert-block alert-warning"> <div class="alert alert-block alert-warning">
<strong>Note!</strong> <strong>Note!</strong>
...@@ -351,9 +331,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -351,9 +331,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</div> </div>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootTabbable', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootTabbable', array(
'type'=>'tabs', 'type'=>'tabs',
'placement'=>'below', // 'above', 'right', 'below' or 'left' 'placement'=>'below', // 'above', 'right', 'below' or 'left'
'tabs'=>array( 'tabs'=>array(
...@@ -361,8 +339,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -361,8 +339,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
array('label'=>'Section 2', 'content'=>'<p>Howdy, I\'m in Section 2.</p>'), array('label'=>'Section 2', 'content'=>'<p>Howdy, I\'m in Section 2.</p>'),
array('label'=>'Section 3', 'content'=>'<p>What up girl, this is Section 3.</p>'), array('label'=>'Section 3', 'content'=>'<p>What up girl, this is Section 3.</p>'),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -383,17 +360,14 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -383,17 +360,14 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootDetailView', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootDetailView', array(
'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'), 'data'=>array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
'attributes'=>array( 'attributes'=>array(
array('name'=>'firstName', 'label'=>'First name'), array('name'=>'firstName', 'label'=>'First name'),
array('name'=>'lastName', 'label'=>'Last name'), array('name'=>'lastName', 'label'=>'Last name'),
array('name'=>'language', 'label'=>'Language'), array('name'=>'language', 'label'=>'Language'),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -443,27 +417,23 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -443,27 +417,23 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php $this->widget('bootstrap.widgets.BootGridView', array( <?php $this->widget('bootstrap.widgets.BootGridView', array(
'type'=>'striped bordered condensed', 'type'=>'striped bordered condensed',
'dataProvider'=>$gridDataProvider, 'dataProvider'=>$gridDataProvider,
'template'=>"{summary}\n{items}\n{pager}", 'template'=>"{items}",
'filter'=>$person->search(), 'filter'=>$person->search(),
'columns'=>$gridColumns, 'columns'=>$gridColumns,
)); ?> )); ?>
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("\$gridDataProvider = new CArrayDataProvider(array(
[php]
\$gridDataProvider = new CArrayDataProvider(array(
array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'), array('id'=>1, 'firstName'=>'Mark', 'lastName'=>'Otto', 'language'=>'CSS'),
array('id'=>2, 'firstName'=>'Jacob', 'lastName'=>'Thornton', 'language'=>'JavaScript'), array('id'=>2, 'firstName'=>'Jacob', 'lastName'=>'Thornton', 'language'=>'JavaScript'),
array('id'=>3, 'firstName'=>'Stu', 'lastName'=>'Dent', 'language'=>'HTML'), array('id'=>3, 'firstName'=>'Stu', 'lastName'=>'Dent', 'language'=>'HTML'),
)); ));"); ?>
~~~
~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootGridView', array(
[php] 'type'=>'striped bordered condensed',
<?php \$this->widget('bootstrap.widgets.BootGridView', array(
'dataProvider'=>\$gridDataProvider, 'dataProvider'=>\$gridDataProvider,
'template'=>\"{items}\", 'template'=>\"{items}\",
'itemsCssClass'=>'table table-striped table-bordered table-condensed',
'columns'=>array( 'columns'=>array(
array('name'=>'id', 'header'=>'#'), array('name'=>'id', 'header'=>'#'),
array('name'=>'firstName', 'header'=>'First name'), array('name'=>'firstName', 'header'=>'First name'),
...@@ -474,8 +444,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -474,8 +444,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
'htmlOptions'=>array('style'=>'width: 50px'), 'htmlOptions'=>array('style'=>'width: 50px'),
), ),
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -498,9 +467,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -498,9 +467,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootThumbnails', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootThumbnails', array(
'dataProvider'=>\$listDataProvider, 'dataProvider'=>\$listDataProvider,
'template'=>\"{items}\\n{pager}\", 'template'=>\"{items}\\n{pager}\",
'itemView'=>'_thumb', 'itemView'=>'_thumb',
...@@ -509,17 +476,13 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -509,17 +476,13 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
jQuery('.tooltip').remove(); jQuery('.tooltip').remove();
jQuery('a[rel=tooltip]').tooltip(); jQuery('a[rel=tooltip]').tooltip();
}\", }\",
)); ?> )); ?>"); ?>
~~~
**\_thumb.php** <?php echo $htmlLighter->highlight("<li class=\"span3\">
~~~
[html]
<li class=\"span3\">
<a href=\"#\" class=\"thumbnail\" rel=\"tooltip\" data-title=\"Tooltip\"> <a href=\"#\" class=\"thumbnail\" rel=\"tooltip\" data-title=\"Tooltip\">
<img src=\"http://placehold.it/280x180\" alt=\"\"> <img src=\"http://placehold.it/280x180\" alt=\"\">
</a> </a>
</li> </li>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -543,9 +506,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -543,9 +506,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $htmlLighter->highlight("<p class=\"well\">
[html]
<p class=\"well\">
Lorem ipsum dolor sit <a href=\"#\" rel=\"tooltip\" title=\"First tooltip\">amet</a>, Lorem ipsum dolor sit <a href=\"#\" rel=\"tooltip\" title=\"First tooltip\">amet</a>,
consectetur adipiscing elit. consectetur adipiscing elit.
Fusce ut velit sem, id elementum elit. Quisque tincidunt magna in quam luctus a ultrices tellus luctus. Fusce ut velit sem, id elementum elit. Quisque tincidunt magna in quam luctus a ultrices tellus luctus.
...@@ -555,8 +516,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -555,8 +516,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
Maecenas nec ligula sed ipsum posuere sollicitudin pretium ac sapien. Maecenas nec ligula sed ipsum posuere sollicitudin pretium ac sapien.
Sed odio dui, pretium eu pellentesque ac, Sed odio dui, pretium eu pellentesque ac,
<a href=\"#\" rel=\"tooltip\" title=\"Yet another tooltip\">tempor</a> sed sem. <a href=\"#\" rel=\"tooltip\" title=\"Yet another tooltip\">tempor</a> sed sem.
</p> </p>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -577,10 +537,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -577,10 +537,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php echo CHtml::link('Hover me', '#', array('class'=>'btn btn-primary btn-danger', 'data-title'=>'Heading', 'data-content'=>'Content ...', 'rel'=>'popover')); ?>"); ?>
[php]
<?php echo CHtml::link('Hover me', '#', array('class'=>'btn btn-primary btn-danger', 'data-title'=>'Heading', 'data-content'=>'Content ...', 'rel'=>'popover')); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -592,12 +549,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -592,12 +549,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php $this->beginWidget('bootstrap.widgets.BootModal', array( <?php $this->beginWidget('bootstrap.widgets.BootModal', array(
'id'=>'modal', 'id'=>'modal',
'htmlOptions'=>array('class'=>'hide'),
'events'=>array( 'events'=>array(
'show'=>"js:function() { console.log('modal show.'); }", 'show'=>"js:function() { console.log('Modal show.'); }",
'shown'=>"js:function() { console.log('modal shown.'); }", 'shown'=>"js:function() { console.log('Modal shown.'); }",
'hide'=>"js:function() { console.log('modal hide.'); }", 'hide'=>"js:function() { console.log('Modal hide.'); }",
'hidden'=>"js:function() { console.log('modal hidden.'); }", 'hidden'=>"js:function() { console.log('Modal hidden.'); }",
), ),
)); ?> )); ?>
...@@ -605,12 +561,14 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -605,12 +561,14 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<a class="close" data-dismiss="modal">&times;</a> <a class="close" data-dismiss="modal">&times;</a>
<h3>Modal header</h3> <h3>Modal header</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>One fine body...</p> <p>One fine body...</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<?php echo CHtml::link('Save changes', '#', array('class'=>'btn btn-primary', 'data-dismiss'=>'modal')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('type'=>'primary', 'label'=>'Save changes', 'url'=>'#', 'htmlOptions'=>array('data-dismiss'=>'modal'))); ?>
<?php echo CHtml::link('Close', '#', array('class'=>'btn', 'data-dismiss'=>'modal')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('label'=>'Close', 'url'=>'#', 'htmlOptions'=>array('data-dismiss'=>'modal'))); ?>
</div> </div>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
...@@ -624,41 +582,42 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -624,41 +582,42 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->beginWidget('bootstrap.widgets.BootModal', array(
[php]
<?php \$this->beginWidget('bootstrap.widgets.BootModal', array(
'id'=>'modal', 'id'=>'modal',
'htmlOptions'=>array('class'=>'hide'),
'events'=>array( 'events'=>array(
'show'=>\"js:function() { console.log('modal show.'); }\", 'show'=>\"js:function() { console.log('Modal show.'); }\",
'shown'=>\"js:function() { console.log('modal shown.'); }\", 'shown'=>\"js:function() { console.log('Modal shown.'); }\",
'hide'=>\"js:function() { console.log('modal hide.'); }\", 'hide'=>\"js:function() { console.log('Modal hide.'); }\",
'hidden'=>\"js:function() { console.log('modal hidden.'); }\", 'hidden'=>\"js:function() { console.log('Modal hidden.'); }\",
), ),
)); ?> )); ?>
~~~
~~~
[html]
<div class=\"modal-header\"> <div class=\"modal-header\">
<a class=\"close\" data-dismiss=\"modal\">&times;</a> <a class=\"close\" data-dismiss=\"modal\">&times;</a>
<h3>Modal header</h3> <h3>Modal header</h3>
</div> </div>
<div class=\"modal-body\"> <div class=\"modal-body\">
<p>One fine body…</p> <p>One fine body…</p>
</div> </div>
<div class=\"modal-footer\"> <div class=\"modal-footer\">
<?php echo CHtml::link('Save changes', '#', array('class'=>'btn btn-primary', 'data-dismiss'=>'modal')); ?> <?php \$this->widget('bootstrap.widgets.BootButton', array(
<?php echo CHtml::link('Close', '#', array('class'=>'btn', 'data-dismiss'=>'modal')); ?> 'type'=>'primary',
'label'=>'Save changes',
'url'=>'#',
'htmlOptions'=>array('data-dismiss'=>'modal'),
)); ?>
<?php \$this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Close',
'url'=>'#',
'htmlOptions'=>array('data-dismiss'=>'modal'),
)); ?>
</div> </div>
~~~
~~~
[php]
<?php \$this->endWidget(); ?> <?php \$this->endWidget(); ?>
~~~
~~~ <?php echo CHtml::link('Click me','#modal', array('class'=>'btn btn-primary', 'data-toggle'=>'modal')); ?>"); ?>
[php]
<?php echo CHtml::link('Click me','#modal', array('class'=>'btn btn-primary', 'data-toggle'=>'modal')); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -679,10 +638,25 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -679,10 +638,25 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php echo $form->textFieldRow($model, 'textField', array('class'=>'span3')); ?> <?php echo $form->textFieldRow($model, 'textField', array('class'=>'span3')); ?>
<?php echo $form->passwordFieldRow($model, 'password', array('class'=>'span3')); ?> <?php echo $form->passwordFieldRow($model, 'password', array('class'=>'span3')); ?>
<?php echo $form->checkboxRow($model, 'checkbox'); ?> <?php echo $form->checkboxRow($model, 'checkbox'); ?>
<?php echo CHtml::htmlButton('<i class="icon-ok"></i> Submit', array('class'=>'btn', 'type'=>'submit')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'ok', 'label'=>'Submit')); ?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
<h4>Source code</h4>
<?php echo $phpLighter->highlight("<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'verticalForm',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'span3')); ?>
<?php echo \$form->passwordFieldRow(\$model, 'password', array('class'=>'span3')); ?>
<?php echo \$form->checkboxRow(\$model, 'checkbox'); ?>
<?php \$this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'ok', 'label'=>'Submit')); ?>
<?php \$this->endWidget(); ?>"); ?>
<h3>Search</h3> <h3>Search</h3>
<?php /** @var BootActiveForm $form */ <?php /** @var BootActiveForm $form */
...@@ -693,10 +667,24 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -693,10 +667,24 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)); ?> )); ?>
<?php echo $form->textFieldRow($model, 'textField', array('class'=>'input-medium')); ?> <?php echo $form->textFieldRow($model, 'textField', array('class'=>'input-medium')); ?>
<?php echo CHtml::htmlButton('<i class="icon-search"></i> Search', array('class'=>'btn', 'type'=>'submit')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'search', 'label'=>'Search')); ?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
<h4>Source code</h4>
<?php echo $phpLighter->highlight("<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'searchForm',
'type'=>'search',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'input-medium')); ?>
<?php \$this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'search', 'label'=>'Search')); ?>
<?php \$this->endWidget(); ?>"); ?>
<h3>Inline</h3> <h3>Inline</h3>
<?php /** @var BootActiveForm $form */ <?php /** @var BootActiveForm $form */
...@@ -708,10 +696,25 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -708,10 +696,25 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php echo $form->textFieldRow($model, 'textField', array('class'=>'input-small')); ?> <?php echo $form->textFieldRow($model, 'textField', array('class'=>'input-small')); ?>
<?php echo $form->passwordFieldRow($model, 'password', array('class'=>'input-small')); ?> <?php echo $form->passwordFieldRow($model, 'password', array('class'=>'input-small')); ?>
<?php echo CHtml::htmlButton('Go', array('class'=>'btn', 'type'=>'submit')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'arrow-right', 'label'=>'Log in')); ?>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
<h4>Source code</h4>
<?php echo $phpLighter->highlight("<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'inlineForm',
'type'=>'inline',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'input-small')); ?>
<?php echo \$form->passwordFieldRow(\$model, 'password', array('class'=>'input-small')); ?>
<?php \$this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'icon'=>'arrow-right', 'label'=>'Log in')); ?>
<?php \$this->endWidget(); ?>"); ?>
<h3>Horizontal</h3> <h3>Horizontal</h3>
<?php /** @var BootActiveForm $form */ <?php /** @var BootActiveForm $form */
...@@ -751,61 +754,15 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -751,61 +754,15 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</fieldset> </fieldset>
<div class="form-actions"> <div class="form-actions">
<?php echo CHtml::htmlButton('<i class="icon-ok icon-white"></i> Submit', array('class'=>'btn btn-primary', 'type'=>'submit')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'type'=>'primary', 'icon'=>'ok white', 'label'=>'Submit')); ?>
<?php echo CHtml::htmlButton('<i class="icon-ban-circle"></i> Reset', array('class'=>'btn', 'type'=>'reset')); ?> <?php $this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'reset', 'icon'=>'remove', 'label'=>'Reset')); ?>
</div> </div>
<?php $this->endWidget(); ?> <?php $this->endWidget(); ?>
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php /** @var BootActiveForm \$form */
[php]
<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'verticalForm',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'span3')); ?>
<?php echo \$form->passwordFieldRow(\$model, 'password', array('class'=>'span3')); ?>
<?php echo \$form->checkboxRow(\$model, 'checkbox'); ?>
<?php echo CHtml::htmlButton('<i class=\"icon-ok\"></i> Submit', array('class'=>'btn', 'type'=>'submit')); ?>
<?php \$this->endWidget(); ?>
~~~
~~~
[php]
<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'searchForm',
'type'=>'search',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'input-medium')); ?>
<?php echo CHtml::htmlButton('<i class=\"icon-search\"></i> Search', array('class'=>'btn','type'=>'submit')); ?>
<?php \$this->endWidget(); ?>
~~~
~~~
[php]
<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'inlineForm',
'type'=>'inline',
'htmlOptions'=>array('class'=>'well'),
)); ?>
<?php echo \$form->textFieldRow(\$model, 'textField', array('class'=>'input-small')); ?>
<?php echo \$form->passwordFieldRow(\$model, 'password', array('class'=>'input-small')); ?>
<?php echo CHtml::htmlButton('Go', array('class'=>'btn', 'type'=>'submit')); ?>
<?php \$this->endWidget(); ?>
~~~
~~~
[php]
<?php /** @var BootActiveForm \$form */
\$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array( \$form = \$this->beginWidget('bootstrap.widgets.BootActiveForm', array(
'id'=>'horizontalForm', 'id'=>'horizontalForm',
'type'=>'horizontal', 'type'=>'horizontal',
...@@ -840,12 +797,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -840,12 +797,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</fieldset> </fieldset>
<div class=\"form-actions\"> <div class=\"form-actions\">
<?php echo CHtml::htmlButton('<i class=\"icon-ok icon-white\"></i> Submit', array('class'=>'btn btn-primary', 'type'=>'submit')); ?> <?php \$this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'submit', 'type'=>'primary', 'icon'=>'ok white', 'label'=>'Submit')); ?>
<?php echo CHtml::htmlButton('<i class=\"icon-ban-circle\"></i> Reset', array('class'=>'btn', 'type'=>'reset')); ?> <?php \$this->widget('bootstrap.widgets.BootButton', array('buttonType'=>'reset', 'icon'=>'remove', 'label'=>'Reset')); ?>
</div> </div>
<?php \$this->endWidget(); ?> <?php \$this->endWidget(); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -911,16 +867,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -911,16 +867,11 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootButton', array(
[php]
<p>
<?php \$this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Primary', 'label'=>'Primary',
'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse' 'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'size'=>'large', // '', 'large', 'small' or 'mini' 'size'=>'large', // '', 'large', 'small' or 'mini'
)); ?> )); ?>"); ?>
</p>
~~~"); ?>
<h3>Button groups</h3> <h3>Button groups</h3>
...@@ -957,6 +908,17 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -957,6 +908,17 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)); ?> )); ?>
</div> </div>
<h4>Source code</h4>
<?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootButtonGroup', array(
'buttons'=>array(
array('label'=>'1', 'url'=>'#'),
array('label'=>'2', 'url'=>'#'),
array('label'=>'3', 'url'=>'#'),
array('label'=>'4', 'url'=>'#'),
),
)); ?>"); ?>
<h3>Dropdowns</h3> <h3>Dropdowns</h3>
<div class="btn-toolbar"> <div class="btn-toolbar">
...@@ -1025,9 +987,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -1025,9 +987,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<div class=\"btn-toolbar\">
[php]
<div class=\"btn-toolbar\">
<?php \$this->widget('bootstrap.widgets.BootButtonGroup', array( <?php \$this->widget('bootstrap.widgets.BootButtonGroup', array(
'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse' 'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons'=>array( 'buttons'=>array(
...@@ -1040,8 +1000,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -1040,8 +1000,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)), )),
), ),
)); ?> )); ?>
</div> </div>"); ?>
~~~"); ?>
<h3>Split dropdowns</h3> <h3>Split dropdowns</h3>
...@@ -1116,9 +1075,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -1116,9 +1075,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<div class=\"btn-toolbar\">
[php]
<div class=\"btn-toolbar\">
<?php \$this->widget('bootstrap.widgets.BootButtonGroup', array( <?php \$this->widget('bootstrap.widgets.BootButtonGroup', array(
'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse' 'type'=>'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons'=>array( 'buttons'=>array(
...@@ -1132,14 +1089,13 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -1132,14 +1089,13 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)), )),
), ),
)); ?> )); ?>
</div> </div>"); ?>
~~~"); ?>
<h3>Stateful</h3> <h3>Stateful</h3>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootButton', array( <?php $this->widget('bootstrap.widgets.BootButton', array(
'fn'=>'button', 'buttonType'=>'button',
'type'=>'primary', 'type'=>'primary',
'label'=>'Click me', 'label'=>'Click me',
'loadingText'=>'loading...', 'loadingText'=>'loading...',
...@@ -1159,33 +1115,27 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -1159,33 +1115,27 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootButton', array(
[php] 'buttonType'=>'button',
<?php \$this->widget('bootstrap.widgets.BootButton', array(
'fn'=>'button',
'type'=>'primary', 'type'=>'primary',
'label'=>'Click me', 'label'=>'Click me',
'loadingText'=>'loading...', 'loadingText'=>'loading...',
'htmlOptions'=>array('id'=>'buttonStateful'), 'htmlOptions'=>array('id'=>'buttonStateful'),
)); ?> )); ?>"); ?>
~~~"); ?>
<?php echo $parser->safeTransform("~~~ <?php echo $jsLighter->highlight("$('#buttonStateful').click(function() {
[javascript]
$('#buttonStateful').click(function() {
var btn = $(this); var btn = $(this);
btn.button('loading'); // call the loading function btn.button('loading'); // call the loading function
setTimeout(function() { setTimeout(function() {
btn.button('reset'); // call the reset function btn.button('reset'); // call the reset function
}, 3000); }, 3000);
}); });"); ?>
~~~"); ?>
<h3>Single state</h3> <h3>Single state</h3>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootButton', array( <?php $this->widget('bootstrap.widgets.BootButton', array(
'fn'=>'button', 'buttonType'=>'button',
'type'=>'primary', 'type'=>'primary',
'label'=>'Toggle me', 'label'=>'Toggle me',
'toggle'=>true, 'toggle'=>true,
...@@ -1194,23 +1144,62 @@ $('#buttonStateful').click(function() { ...@@ -1194,23 +1144,62 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootButton', array(
[php] 'buttonType'=>'button',
<?php \$this->widget('bootstrap.widgets.BootButton', array(
'fn'=>'button',
'type'=>'primary', 'type'=>'primary',
'label'=>'Toggle me', 'label'=>'Toggle me',
'toggle'=>true, 'toggle'=>true,
)); ?> )); ?>"); ?>
~~~"); ?>
<div class="row">
<div class="span3">
<h3>Checkbox</h3> <h3>Checkbox</h3>
<p>@todo</p> <?php $this->widget('bootstrap.widgets.BootButtonGroup', array(
'type' => 'primary',
'toggle' => 'checkbox',
'buttons' => array(
array('label'=>'Left'),
array('label'=>'Middle'),
array('label'=>'Right'),
),
)); ?>
<br />
</div>
<div class="span3">
<h3>Radio</h3> <h3>Radio</h3>
<p>@todo</p> <?php $this->widget('bootstrap.widgets.BootButtonGroup', array(
'type' => 'primary',
'toggle' => 'radio',
'buttons' => array(
array('label'=>'Left'),
array('label'=>'Middle'),
array('label'=>'Right'),
),
)); ?>
<br />
</div>
</div>
<h4>Source code</h4>
<?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootButtonGroup', array(
'type' => 'primary',
'toggle' => 'radio', // 'checkbox' or 'radio'
'buttons' => array(
array('label'=>'Left'),
array('label'=>'Middle'),
array('label'=>'Right'),
),
)); ?>"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1229,21 +1218,14 @@ $('#buttonStateful').click(function() { ...@@ -1229,21 +1218,14 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->beginWidget('bootstrap.widgets.BootHero', array(
[php]
<?php \$this->beginWidget('bootstrap.widgets.BootHero', array(
'heading'=>'Hello, world!', 'heading'=>'Hello, world!',
)); ?> )); ?>"); ?>
~~~
~~~ <?php echo $htmlLighter->highlight("<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
[html] <p><a class=\"btn btn-primary btn-large\">Learn more</a></p>"); ?>
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p><a class=\"btn btn-primary btn-large\">Learn more</a></p> <?php echo $phpLighter->highlight("<?php \$this->endWidget(); ?>"); ?>
~~~
~~~
[php]
<?php \$this->endWidget(); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1267,9 +1249,7 @@ $('#buttonStateful').click(function() { ...@@ -1267,9 +1249,7 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootCarousel', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootCarousel', array(
'items'=>array( 'items'=>array(
array('image'=>'http://placehold.it/770x400&text=First+thumbnail', 'label'=>'First Thumbnail label', 'caption'=>'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('image'=>'http://placehold.it/770x400&text=First+thumbnail', 'label'=>'First Thumbnail label', 'caption'=>'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'),
array('image'=>'http://placehold.it/770x400&text=Second+thumbnail', 'label'=>'Second Thumbnail label', 'caption'=>'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('image'=>'http://placehold.it/770x400&text=Second+thumbnail', 'label'=>'Second Thumbnail label', 'caption'=>'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'),
...@@ -1279,8 +1259,7 @@ $('#buttonStateful').click(function() { ...@@ -1279,8 +1259,7 @@ $('#buttonStateful').click(function() {
'slide'=>\"js:function() { console.log('Carousel slide.'); }\", 'slide'=>\"js:function() { console.log('Carousel slide.'); }\",
'slid'=>\"js:function() { console.log('Carousel slid.'); }\", 'slid'=>\"js:function() { console.log('Carousel slid.'); }\",
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1331,15 +1310,12 @@ $('#buttonStateful').click(function() { ...@@ -1331,15 +1310,12 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootProgress', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootProgress', array(
'type'=>'danger', // '', 'info', 'success' or 'danger' 'type'=>'danger', // '', 'info', 'success' or 'danger'
'percent'=>40, // the progress 'percent'=>40, // the progress
'striped'=>true, 'striped'=>true,
'animated'=>true, 'animated'=>true,
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1365,9 +1341,7 @@ $('#buttonStateful').click(function() { ...@@ -1365,9 +1341,7 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootTypeahead', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootTypeahead', array(
'options'=>array( 'options'=>array(
'source'=>array('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Dakota', 'North Carolina', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'), 'source'=>array('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Dakota', 'North Carolina', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'),
'items'=>4, 'items'=>4,
...@@ -1375,8 +1349,7 @@ $('#buttonStateful').click(function() { ...@@ -1375,8 +1349,7 @@ $('#buttonStateful').click(function() {
return ~item.toLowerCase().indexOf(this.query.toLowerCase()); return ~item.toLowerCase().indexOf(this.query.toLowerCase());
}\", }\",
), ),
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1384,7 +1357,7 @@ $('#buttonStateful').click(function() { ...@@ -1384,7 +1357,7 @@ $('#buttonStateful').click(function() {
<section id="bootLabel"> <section id="bootLabel">
<h2>Labels <small>Coming in 1.0.0</small></h2> <h2>Labels</h2>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootLabel', array('label'=>'Default')); ?> <?php $this->widget('bootstrap.widgets.BootLabel', array('label'=>'Default')); ?>
...@@ -1397,13 +1370,10 @@ $('#buttonStateful').click(function() { ...@@ -1397,13 +1370,10 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootLabel', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootLabel', array(
'type'=>'success', // '', 'success', 'warning', 'important', 'info' or 'inverse' 'type'=>'success', // '', 'success', 'warning', 'important', 'info' or 'inverse'
'label'=>'Success', 'label'=>'Success',
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
...@@ -1411,7 +1381,7 @@ $('#buttonStateful').click(function() { ...@@ -1411,7 +1381,7 @@ $('#buttonStateful').click(function() {
<section id="bootBadge"> <section id="bootBadge">
<h2>Badges <small>Coming in 1.0.0</small></h2> <h2>Badges</h2>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootBadge', array('label'=>'1')); ?> <?php $this->widget('bootstrap.widgets.BootBadge', array('label'=>'1')); ?>
...@@ -1424,13 +1394,10 @@ $('#buttonStateful').click(function() { ...@@ -1424,13 +1394,10 @@ $('#buttonStateful').click(function() {
<h4>Source code</h4> <h4>Source code</h4>
<?php echo $parser->safeTransform("~~~ <?php echo $phpLighter->highlight("<?php \$this->widget('bootstrap.widgets.BootBadge', array(
[php]
<?php \$this->widget('bootstrap.widgets.BootBadge', array(
'type'=>'success', // '', 'success', 'warning', 'error', 'info' or 'inverse' 'type'=>'success', // '', 'success', 'warning', 'error', 'info' or 'inverse'
'label'=>'2', 'label'=>'2',
)); ?> )); ?>"); ?>
~~~"); ?>
<a class="top" href="#top">Back to top &uarr;</a> <a class="top" href="#top">Back to top &uarr;</a>
......
...@@ -15,15 +15,15 @@ Yii::import('bootstrap.widgets.BootWidget'); ...@@ -15,15 +15,15 @@ Yii::import('bootstrap.widgets.BootWidget');
*/ */
class BootButton extends BootWidget class BootButton extends BootWidget
{ {
// Button callback functions. // Button callback types.
const FN_LINK = 'link'; const BUTTON_LINK = 'link';
const FN_BUTTON = 'button'; const BUTTON_BUTTON = 'button';
const FN_SUBMIT = 'submit'; const BUTTON_SUBMIT = 'submit';
const FN_SUBMITLINK = 'submitLink'; const BUTTON_SUBMITLINK = 'submitLink';
const FN_RESET = 'reset'; const BUTTON_RESET = 'reset';
const FN_AJAXLINK = 'ajaxLink'; const BUTTON_AJAXLINK = 'ajaxLink';
const FN_AJAXBUTTON = 'ajaxButton'; const BUTTON_AJAXBUTTON = 'ajaxButton';
const FN_AJAXSUBMIT = 'ajaxSubmit'; const BUTTON_AJAXSUBMIT = 'ajaxSubmit';
// Button types. // Button types.
const TYPE_NORMAL = ''; const TYPE_NORMAL = '';
...@@ -41,10 +41,10 @@ class BootButton extends BootWidget ...@@ -41,10 +41,10 @@ class BootButton extends BootWidget
const SIZE_LARGE = 'large'; const SIZE_LARGE = 'large';
/** /**
* @var string the callback function for rendering the button. * @var string the button callback types.
* Valid values are 'link', 'button', 'submit', 'submitLink', 'reset', 'ajaxLink', 'ajaxButton' and 'ajaxSubmit'. * Valid values are 'link', 'button', 'submit', 'submitLink', 'reset', 'ajaxLink', 'ajaxButton' and 'ajaxSubmit'.
*/ */
public $fn = self::FN_LINK; public $buttonType = self::BUTTON_LINK;
/** /**
* @var string the button type. * @var string the button type.
* Valid values are '', 'primary', 'info', 'success', 'warning', 'danger' and 'inverse'. * Valid values are '', 'primary', 'info', 'success', 'warning', 'danger' and 'inverse'.
...@@ -97,7 +97,7 @@ class BootButton extends BootWidget ...@@ -97,7 +97,7 @@ class BootButton extends BootWidget
public $ajaxOptions = array(); public $ajaxOptions = array();
/** /**
* @var array the HTML options for the dropdown menu. * @var array the HTML options for the dropdown menu.
* @since 1.0.0 * @since 0.9.11
*/ */
public $dropdownOptions = array(); public $dropdownOptions = array();
...@@ -181,12 +181,14 @@ class BootButton extends BootWidget ...@@ -181,12 +181,14 @@ class BootButton extends BootWidget
echo $this->createButton(); echo $this->createButton();
if ($this->hasDropdown()) if ($this->hasDropdown())
{
$this->controller->widget('bootstrap.widgets.BootDropdown', array( $this->controller->widget('bootstrap.widgets.BootDropdown', array(
'encodeLabel'=>$this->encodeLabel, 'encodeLabel'=>$this->encodeLabel,
'items'=>$this->items, 'items'=>$this->items,
'htmlOptions'=>$this->dropdownOptions, 'htmlOptions'=>$this->dropdownOptions,
)); ));
} }
}
/** /**
* Creates the button element. * Creates the button element.
...@@ -194,31 +196,31 @@ class BootButton extends BootWidget ...@@ -194,31 +196,31 @@ class BootButton extends BootWidget
*/ */
protected function createButton() protected function createButton()
{ {
switch ($this->fn) switch ($this->buttonType)
{ {
case self::FN_BUTTON: case self::BUTTON_BUTTON:
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_SUBMIT: case self::BUTTON_SUBMIT:
$this->htmlOptions['type'] = 'submit'; $this->htmlOptions['type'] = 'submit';
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_RESET: case self::BUTTON_RESET:
$this->htmlOptions['type'] = 'reset'; $this->htmlOptions['type'] = 'reset';
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_SUBMITLINK: case self::BUTTON_SUBMITLINK:
return CHtml::linkButton($this->label, $this->htmlOptions); return CHtml::linkButton($this->label, $this->htmlOptions);
case self::FN_AJAXLINK: case self::BUTTON_AJAXLINK:
return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions); return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions);
case self::FN_AJAXBUTTON: case self::BUTTON_AJAXBUTTON:
$this->ajaxOptions['url'] = $this->url; $this->ajaxOptions['url'] = $this->url;
$this->htmlOptions['ajax'] = $this->ajaxOptions; $this->htmlOptions['ajax'] = $this->ajaxOptions;
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_AJAXSUBMIT: case self::BUTTON_AJAXSUBMIT:
$this->ajaxOptions['type'] = 'POST'; $this->ajaxOptions['type'] = 'POST';
$this->ajaxOptions['url'] = $this->url; $this->ajaxOptions['url'] = $this->url;
$this->htmlOptions['type'] = 'submit'; $this->htmlOptions['type'] = 'submit';
...@@ -226,7 +228,7 @@ class BootButton extends BootWidget ...@@ -226,7 +228,7 @@ class BootButton extends BootWidget
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
default: default:
case self::FN_LINK: case self::BUTTON_LINK:
return CHtml::link($this->label, $this->url, $this->htmlOptions); return CHtml::link($this->label, $this->url, $this->htmlOptions);
} }
} }
......
...@@ -21,10 +21,10 @@ class BootButtonGroup extends BootWidget ...@@ -21,10 +21,10 @@ class BootButtonGroup extends BootWidget
const TOGGLE_RADIO = 'radio'; const TOGGLE_RADIO = 'radio';
/** /**
* @var string the button function. * @var string the button callback type.
* @see BootButton::fn * @see BootButton::buttonType
*/ */
public $fn = BootButton::FN_LINK; public $buttonType = BootButton::BUTTON_LINK;
/** /**
* @var string the button type. * @var string the button type.
* @see BootButton::type * @see BootButton::type
...@@ -78,7 +78,7 @@ class BootButtonGroup extends BootWidget ...@@ -78,7 +78,7 @@ class BootButtonGroup extends BootWidget
foreach ($this->buttons as $button) foreach ($this->buttons as $button)
{ {
$this->controller->widget('bootstrap.widgets.BootButton', array( $this->controller->widget('bootstrap.widgets.BootButton', array(
'fn'=>isset($button['fn']) ? $button['fn'] : $this->fn, 'buttonType'=>isset($button['buttonType']) ? $button['buttonType'] : $this->buttonType,
'type'=>isset($button['type']) ? $button['type'] : $this->type, 'type'=>isset($button['type']) ? $button['type'] : $this->type,
'size'=>$this->size, 'size'=>$this->size,
'icon'=>isset($button['icon']) ? $button['icon'] : null, 'icon'=>isset($button['icon']) ? $button['icon'] : null,
......
...@@ -27,13 +27,18 @@ class BootModal extends BootWidget ...@@ -27,13 +27,18 @@ class BootModal extends BootWidget
if (!isset($this->htmlOptions['id'])) if (!isset($this->htmlOptions['id']))
$this->htmlOptions['id'] = $this->getId(); $this->htmlOptions['id'] = $this->getId();
$class = array('modal');
if (Yii::app()->bootstrap->isPluginRegistered(Bootstrap::PLUGIN_TRANSITION))
$class[] = 'fade';
$cssClass = implode(' ', $class);
if (isset($this->htmlOptions['class'])) if (isset($this->htmlOptions['class']))
$this->htmlOptions['class'] .= ' modal'; $this->htmlOptions['class'] .= ' '.$cssClass;
else else
$this->htmlOptions['class'] = 'modal'; $this->htmlOptions['class'] = $cssClass;
if (Yii::app()->bootstrap->isPluginRegistered(Bootstrap::PLUGIN_TRANSITION))
$this->htmlOptions['class'] .= ' fade';
echo CHtml::openTag('div', $this->htmlOptions).PHP_EOL; echo CHtml::openTag('div', $this->htmlOptions).PHP_EOL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment