russ666/yii2-buttons-group-input Yii2 buttons group input

bootstrapbuttongroupinput

Usage

Simple

echo \russ666\widgets\ButtonsGroupInput::widget([
    'name' => 'elements',
    'value' => [2,3],
    'items' => [
        1 => 'Element 1',
        2 => 'Element 2',
        3 => 'Element 3',
    ]
]);

Form Input

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.

size

Bootstrap button size. lg, xs etc.

radio

Flag to use buttons group as radio or checkboxes.

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,
]);

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
1 github stars & 1 github forks
0 downloads in the last day
38 downloads in the last 30 days
804 total downloads