wbraganca/yii2-selectivity
最新稳定版本:2.0.2
Composer 安装命令:
composer require wbraganca/yii2-selectivity
包简介
The yii2-selectivity is a Yii 2 wrapper for [selectivity](https://arendjr.github.io/selectivity/). A modular and light-weight selection library for jQuery and Zepto.js.
README 文档
README
Install
Via Composer
$ composer require wbraganca/yii2-selectivity
or add
"wbraganca/yii2-selectivity": "~2.0.1"
to the require section of your composer.json file.
Usage
On your view file.
<?php use wbraganca\selectivity\SelectivityWidget; ?> <?= $form->field($model, 'city', [ 'options' => ['class' => 'selectivity-container form-group'] ])->widget(SelectivityWidget::classname(), [ 'options' => [ 'prompt' => '', ], 'pluginOptions' => [ 'allowClear' => true, 'data' => ['Rio de Janeiro', 'São Paulo'], 'placeholder' => 'No city selected' ] ]) ?>
Displaying the data with appended addon
<?= $form->field($model, 'city', [ 'options' => ['class' => 'selectivity-container form-group'] ])->widget(SelectivityWidget::classname(), [ 'options' => [ 'prompt' => '' ], 'pluginOptions' => [ 'allowClear' => true, 'data' => ['Rio de Janeiro', 'São Paulo'], 'placeholder' => 'No city selected' ], 'template' => '<div class="input-group">' . '{input}' . '<div class="input-group-append">' . '<span class="input-group-btn">' . '<button class="btn btn-success" type="button">' . '<i class="fa fa-plus"></i>' . '</button>' . '</div>' . '</span>' . '</div>' ]) ?>
For more options, visit: https://arendjr.github.io/selectivity/#api
统计信息
- 总下载量: 3.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-07-04