akavov / yii2-bootstrap-tokenfield
Create elegant taggable fields with copy/paste and keyboard support using Bootstrap Tokefield
Installs: 2 406
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- bower-asset/bootstrap: >=3.1.1
- bower-asset/jquery: >=2.1.0
- bower-asset/jqueryui: >=1.11.4
- bower-asset/typeahead.js: >=0.10.1
- npm-asset/bootstrap-tokenfield: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-03-01 21:06:24 UTC
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