Commit 420499f9 by Crisu83

added mini button support (fixes #31)

parent 90b00207
...@@ -847,7 +847,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -847,7 +847,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<h2>Buttons</h2> <h2>Buttons</h2>
<div class="row"> <div class="row">
<div class="span4"> <div class="span3">
<h3>Large</h3> <h3>Large</h3>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootButton', array( <?php $this->widget('bootstrap.widgets.BootButton', array(
...@@ -860,7 +860,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -860,7 +860,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</p> </p>
</div> </div>
<div class="span4"> <div class="span3">
<h3>Normal</h3> <h3>Normal</h3>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootButton', array( <?php $this->widget('bootstrap.widgets.BootButton', array(
...@@ -873,7 +873,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -873,7 +873,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
</p> </p>
</div> </div>
<div class="span4"> <div class="span3">
<h3>Small</h3> <h3>Small</h3>
<p> <p>
<?php $this->widget('bootstrap.widgets.BootButton', array( <?php $this->widget('bootstrap.widgets.BootButton', array(
...@@ -885,6 +885,19 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -885,6 +885,19 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
)); ?> )); ?>
</p> </p>
</div> </div>
<div class="span3">
<h3>Mini</h3>
<p>
<?php $this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Primary', 'type'=>'primary', 'size'=>'mini',
)); ?>
<?php $this->widget('bootstrap.widgets.BootButton', array(
'label'=>'Action', 'size'=>'mini',
)); ?>
</p>
</div>
</div> </div>
<h4>Source code</h4> <h4>Source code</h4>
...@@ -895,7 +908,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin ...@@ -895,7 +908,7 @@ Yii::app()->user->setFlash('error', '<strong>Oh snap!</strong> Change a few thin
<?php \$this->widget('bootstrap.widgets.BootButton', array( <?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'=>'small', // '', 'small' or 'large' 'size'=>'large', // '', 'large', 'small' or 'mini'
)); ?> )); ?>
</p> </p>
~~~"); ?> ~~~"); ?>
......
...@@ -35,6 +35,7 @@ class BootButton extends BootWidget ...@@ -35,6 +35,7 @@ class BootButton extends BootWidget
const TYPE_INVERSE = 'inverse'; const TYPE_INVERSE = 'inverse';
// Button sizes. // Button sizes.
const SIZE_MINI = 'mini';
const SIZE_SMALL = 'small'; const SIZE_SMALL = 'small';
const SIZE_NORMAL = ''; const SIZE_NORMAL = '';
const SIZE_LARGE = 'large'; const SIZE_LARGE = 'large';
...@@ -113,7 +114,7 @@ class BootButton extends BootWidget ...@@ -113,7 +114,7 @@ class BootButton extends BootWidget
if (isset($this->type) && in_array($this->type, $validTypes)) if (isset($this->type) && in_array($this->type, $validTypes))
$class[] = 'btn-'.$this->type; $class[] = 'btn-'.$this->type;
$validSizes = array(self::SIZE_SMALL, self::SIZE_LARGE); $validSizes = array(self::SIZE_LARGE, self::SIZE_SMALL, self::SIZE_MINI);
if (isset($this->size) && in_array($this->size, $validSizes)) if (isset($this->size) && in_array($this->size, $validSizes))
$class[] = 'btn-'.$this->size; $class[] = 'btn-'.$this->size;
......
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