akavov/yii2-bootstrap-tokenfield
最新稳定版本:0.1.0
Composer 安装命令:
composer require akavov/yii2-bootstrap-tokenfield
包简介
Create elegant taggable fields with copy/paste and keyboard support using Bootstrap Tokefield
README 文档
README
Create elegant taggable fields with copy/paste and keyboard support using Bootstrap Tokefield (http://sliptree.github.io/bootstrap-tokenfield/)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist akavov/yii2-bootstrap-tokenfield : "*"
or add
"akavov/yii2-bootstrap-tokenfield": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \akavov\tokenfield\Tokenfield::widget([
'name' => 'inputName',
]);
to use autocomplete
<?= \akavov\tokenfield\Tokenfield::widget([
'name' => 'inputName',
"pluginOptions" => [
'delimiter' => '#', // default ',' (comma)
'showAutocompleteOnFocus' => true,
'autocomplete' => [
'source' => ['red','blue','green','yellow','violet','brown','purple','black','white'],
'delay' => 100
],
],
]);
to use with ActiveForm
<?= $form->field($model, 'name')->widget(\akavov\tokenfield\Tokenfield::className(), [
'pluginOptions' => [
'delimiter' => '#', // default ',' (comma)
'showAutocompleteOnFocus' => true,
'autocomplete' => [
'source' => ['red','blue','green','yellow','violet','brown','purple','black','white'],
'delay' => 100
],
],
]); ?>
TODO
- Add ability to choose between jqueryui and typeahead
- Test
统计信息
- 总下载量: 2.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-28