Button Group

THE solution for toolbars

Basic example of usage is this:

$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'buttons' => array(
            array('label' => 'Left', 'url' => '#'),
            array('label' => 'Middle', 'url' => '#'),
            array('label' => 'Right', 'url' => '#')
        ),
    )
);

Here's all configuration properties which you can set for TbButtonGroup widget.

Property Description
type name = default description

Justified button groups

$this->widget(
	'booster.widgets.TbButtonGroup',
	array(
		'justified' => true,
		'buttons' => array(
            array('label' => 'Left', 'url' => '#'),
            array('label' => 'Middle', 'url' => '#'),
            array('label' => 'Right', 'url' => '#')
		),
	)
);

Multiple button groups

$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'buttons' => array(
            array('label' => '1', 'url' => '#'),
            array('label' => '2', 'url' => '#'),
            array('label' => '3', 'url' => '#'),
            array('label' => '4', 'url' => '#'),
        ),
    )
); echo ' ';
$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'buttons' => array(
            array('label' => '5', 'url' => '#'),
            array('label' => '6', 'url' => '#'),
            array('label' => '7', 'url' => '#'),
        ),
    )
); echo ' ';
$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'buttons' => array(
            array('label' => '8', 'url' => '#'),
        ),
    )
);

Vertical button groups

Make a set of buttons appear vertically stacked rather than horizontally.

$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'stacked' => true,
        'buttons' => array(
            array(
                'buttonType' => 'button',
                'url' => '#',
                'icon' => 'align-left'
            ),
            array(
                'buttonType' => 'button',
                'url' => '#',
                'icon' => 'align-center'
            ),
            array(
                'buttonType' => 'button',
                'url' => '#',
                'icon' => 'align-right'
            ),
            array(
                'buttonType' => 'button',
                'url' => '#',
                'icon' => 'align-justify'
            ),
        ),
    )
);

Radio or checkbox

$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'context' => 'primary',
        'toggle' => 'radio',
        'buttons' => array(
            array('label' => 'Lefst', 'icon'=>'arrow-left'),
            array('label' => 'Middle', 'icon'=>'arrow-up'),
            array('label' => 'Right', 'icon'=>'arrow-right'),
        ),
    )
);


In order to display one or the other, configure its toggle attribute.

$this->widget(
    'booster.widgets.TbButtonGroup',
    array(
        'toggle' => 'checkbox',
        'buttons' => array(
            array('label' => 'Left'),
            array('label' => 'Middle'),
            array('label' => 'Right'),
        ),
    )
);