Button

The simplest of them all

Chances are, you know what this widget should do. It is a PHP wrapper around making a proper Twitter Bootstrap button, as described in their documentation for buttons.

Basic example of usage is this:

$this->widget(
    'booster.widgets.TbButton',
    array(
        'label' => 'Common',
    )
); echo ' ';
$this->widget(
    'booster.widgets.TbButton',
    array(
        'label' => 'Primary',
        'context' => 'primary',
    )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Success',
            'context' => 'success',
        )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Info',
            'context' => 'info',
        )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Warning',
            'context' => 'warning',
        )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Danger',
            'context' => 'danger',
        )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Danger',
            'context' => 'link',
        )
); echo ' ';

Property Description
string context = "default" The button "type", which affects its appearance only. Possible values are described in the "Constants -> Button Types" section below.
string size = The button size. Possible values are described in "Constants -> Button Sizes" section below.
string label = What is printed on the button.
string icon = Name of the button icon, according to the icon names defined in Twitter Bootstrap documentation. Of course, if you enabled FontAwesome, you can use names from there, too. Please note that you should not write the "icon-" prefix when specifying icon names.
string url = If the button is rendered as HTML link, what "href" it should have.

You can use different type of sizes by setting its size attribute to large, small, or mini.

$this->widget(
    'booster.widgets.TbButton',
    array(
        'label' => 'Large',
        'size' => 'large'
    )
); echo ' ';
$this->widget(
        'booster.widgets.TbButton',
        array(
            'label' => 'Defailt',
            'size' => 'default'
        )
); echo ' ';
$this->widget(
    'booster.widgets.TbButton',
    array(
        'label' => 'Small',
        'size' => 'small'
    )
); echo ' ';
$this->widget(
    'booster.widgets.TbButton',
    array(
        'label' => 'Extra small',
        'size' => 'extra_small'
    )
); echo ' ';