2017 © Pedro Peláez
 

yii2-extension yii2-buttons-group-input

Yii2 buttons group input

image

russ666/yii2-buttons-group-input

Yii2 buttons group input

  • Wednesday, March 4, 2015
  • by russ666
  • Repository
  • 2 Watchers
  • 1 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

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

The Versions

04/03 2015

dev-master

9999999-dev

Yii2 buttons group input

  Sources   Download

MIT

The Requires

 

yii2 bootstrap button input group