Usage
Simple
echo \russ666\widgets\ButtonsGroupInput::widget([
'name' => 'elements',
'value' => [2,3],
'items' => [
1 => 'Element 1',
2 => 'Element 2',
3 => 'Element 3',
]
]);
echo $form->field($model, 'elements')->widget(\russ666\widgets\ButtonsGroupInput::className(), [
'items' => [
1 => 'Element 1',
2 => 'Element 2',
3 => 'Element 3',
]
]);
Params
type
Bootstrap button type. primary
, danger
etc., (*1)
size
Bootstrap button size. lg
, xs
etc., (*2)
radio
Flag to use buttons group as radio or checkboxes., (*3)
Example
echo \russ666\widgets\ButtonsGroupInput::widget([
'name' => 'elements',
'value' => [2,3],
'items' => [
1 => 'Element 1',
2 => 'Element 2',
3 => 'Element 3',
],
'type' => 'danger',
'size' => 'xs',
'radio' => false,
]);