kak/select2
最新稳定版本:1.0.1
Composer 安装命令:
composer require kak/select2
包简介
select2 widgets for Yii2
README 文档
README
Select2 widgets for Yii2
Preview
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist kak/select2 "dev-master"
or add
"kak/select2": "dev-master"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \kak\widgets\select2\Select2::widget([ 'toggleEnable' => false, // visible select all/unselect all 'selectLabel' => 'select all', 'unselectLabel' => 'unselect all', 'options' => [ 'data-scroll-height' => 150, // auto scroll 'data-item-width' => 100, // 100|auto ] 'multiple' => true, 'value' => ['val1','val2'], 'name' => 'inputName', 'items' => [ 'val1' => 'options1', 'val2' => 'options2', 'val3' => 'options3', 'val4' => 'options4', ], ]); ?>
<?= $form->field($model, 'list')->widget('\kak\widgets\select2\Select2', [ 'items' => [ 'val1' => 'options1', 'val2' => 'options2', 'val3' => 'options3', 'val4' => 'options4', ], 'options' => [ 'class' => 'myCssClass' ], 'clientOptions' => [], // js options select2 ]) ?>
统计信息
- 总下载量: 3.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-20