wbraganca / yii2-multiselect
yii2-multiselect 是一个 Bootstrap Multiselect([Bootstrap Multiselect](http://davidstutz.github.io/bootstrap-multiselect/))的 Yii 2 封装。
1.0.2
2016-10-27 11:00 UTC
Requires
- bower-asset/bootstrap-multiselect: ~0.9
- bower-asset/multiselect: ~0.9
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-bootstrap: ~2.0.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-09-14 19:42:20 UTC
README
安装
通过 Composer
$ composer require "wbraganca/yii2-multiselect:~1.0.1"
或者在您的 composer.json
文件的 require 部分添加
"wbraganca/yii2-multiselect": "~1.0.1"
。
使用方法
在您的视图文件中。
<?php use wbraganca\multiselect\MultiSelectWidget; ?> <?= MultiSelect::widget([ 'options' => [ 'multiple' => 'multiple', ], 'clientOptions' => [ 'nonSelectedText' => 'Check an option!', 'nSelectedText' => ' - Options selected!', 'allSelectedText' => 'All', 'selectAllText' => 'Check all!', 'numberDisplayed' => 1, 'enableCaseInsensitiveFiltering' => true, 'maxHeight' => 300, // The maximum height of the dropdown. This is useful when using the plugin with plenty of options. 'includeSelectAllOption' => true ], 'data' => $cities, 'model' => $model, 'attribute' => 'cities', ]) ?>