maximkozhin / yii2-checkbox-serial
Yii2 的复选框输入小部件
1.0.0
2017-05-18 11:18 UTC
Requires
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-09-29 02:29:02 UTC
README
通过 composer
在文件 'composer.json' 的 'require' 部分添加
"require": {
...
"maximkozhin/yii2-checkbox-serial": "*"
},
或运行以下命令
$ composer require maximkozhin/yii2-checkbox-serial
1. 使用 | Использование
创建主复选框
<?= \maximkozhin\checkboxserial\widgets\CheckboxSerial::widget([
/**
* Generating HTML code:
* <input type="checkbox" ... class="selector-class-for-main-checbox-input" id="id-for-main-checbox-input"
*/
'id' => 'id-for-main-checbox-input',
'selectorClass'=>'selector-class-for-main-checbox-input',
/**
* Generating HTML code:
* <laber for="id-for-main-checbox-input">{{$label}}</label>
*/
'label'=>false //or 'label'=>'Выбрать Все' or 'label'=>'Check All'
])?>
在主复选框之后,您可以添加其他复选框
<?=Html::input('checkbox', 'id[]', $value, ['class'=>'selector-class-for-main-checbox-input'])?>