Drexlerux - Yii2 ICheck
Description:
Setup:, (*1)
php composer.phar require "drexlerux/yii2-icheck" "*"
or, (*2)
composer require drexlerux/yii2-icheck
or add to composer.json, (*3)
"drexlerux/yii2-icheck": "*"
### How to implement:
use drexlerux\ui\ICheck;
STYLE_MIMIMAL (colors for STYLE_MIMIMAL - minimal (the black), red, green, blue, aero, grey, orange, yellow, pink, purple)
= $form->field($model, 'checkbox', ['template' => '{label} {input}'])->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX,
'style' => ICheck::STYLE_MIMIMAL,
'color' => 'green' // Color theme
]) ?>
= $form->field($model, 'checkbox2')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_MIMIMAL,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'minimal', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'checkbox3')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_MIMIMAL,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'red', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
= $form->field($model, 'radio')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO,
'style' => ICheck::STYLE_MIMIMAL,
'color' => 'green' // Color theme
]) ?>
= $form->field($model, 'radio2')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_MIMIMAL,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'purple', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio3')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_MIMIMAL,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'blue', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
STYLE_SQUARE (Colors for STYLE_SQUARE - square (the black), red, green, blue, aero, grey, orange, yellow, pink, purple)
= $form->field($model, 'checkbox4', ['template' => '{label} {input}'])->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX,
'style' => ICheck::STYLE_SQUARE,
'color' => 'square' // Color theme
]) ?>
= $form->field($model, 'checkbox5')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_SQUARE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'green', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
= $form->field($model, 'checkbox6')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_SQUARE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'red', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio4')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO,
'style' => ICheck::STYLE_SQUARE,
'color' => 'blue' // Color theme
]) ?>
= $form->field($model, 'radio5')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_SQUARE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'yellow', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio6')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_SQUARE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'aero', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
STYLE_FLAT (Colors for STYLE_SQUARE - flat (the black), red, green, blue, aero, grey, orange, yellow, pink, purple)
= $form->field($model, 'checkbox7', ['template' => '{label} {input}'])->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX,
'style' => ICheck::STYLE_FLAT,
'color' => 'flat' // Color theme
]) ?>
= $form->field($model, 'checkbox8')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_FLAT,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'green', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
= $form->field($model, 'checkbox9')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_FLAT,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'red', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio7')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO,
'style' => ICheck::STYLE_FLAT,
'color' => 'blue' // Color theme
]) ?>
= $form->field($model, 'radio8')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_FLAT,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'yellow', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio9')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_FLAT,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'aero', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
STYLE_LINE (Colors for STYLE_LINE - line (the black), red, green, blue, aero, grey, orange, yellow, pink, purple)
= $form->field($model, 'checkbox10')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_LINE,
'items' => [1 => 'Вася'],
'color' => 'yellow', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
},
]]) ?>
= $form->field($model, 'checkbox11')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_LINE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'red', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
},
]]) ?>
= $form->field($model, 'radio10')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_LINE,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'color' => 'pink', // Color theme
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
},
]]) ?>
STYLE_POLARIS
= $form->field($model, 'checkbox12', ['template' => '{label} {input}'])->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX,
'style' => ICheck::STYLE_POLARIS,
]) ?>
= $form->field($model, 'checkbox13')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_POLARIS,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
= $form->field($model, 'checkbox14')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_POLARIS,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio11')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO,
'style' => ICheck::STYLE_POLARIS,
]) ?>
= $form->field($model, 'radio12')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_POLARIS,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio13')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_POLARIS,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
STYLE_FUTURICO
= $form->field($model, 'checkbox15', ['template' => '{label} {input}'])->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX,
'style' => ICheck::STYLE_FUTURICO,
]) ?>
= $form->field($model, 'checkbox16')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_FUTURICO,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
= $form->field($model, 'checkbox17')->widget(ICheck::className(), [
'type' => ICheck::TYPE_CHECBOX_LIST,
'style' => ICheck::STYLE_FUTURICO,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio14')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO,
'style' => ICheck::STYLE_FUTURICO,
]) ?>
= $form->field($model, 'radio15')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_FUTURICO,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return '
';
}
]]) ?>
= $form->field($model, 'radio16')->widget(ICheck::className(), [
'type' => ICheck::TYPE_RADIO_LIST,
'style' => ICheck::STYLE_FUTURICO,
'items' => [1 => 'Item 1', 2 => 'Item 2', 3 => 'Item 3']
'options' => [
'item' => function ($index, $label, $name, $checked, $value){
return ' ';
}
]]) ?>
License: