Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/efureev/yii2-tagsinput
Bootstrap Tags Input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags.
https://github.com/efureev/yii2-tagsinput
Last synced: about 6 hours ago
JSON representation
Bootstrap Tags Input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags.
- Host: GitHub
- URL: https://github.com/efureev/yii2-tagsinput
- Owner: efureev
- License: mit
- Created: 2016-09-07T06:21:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-08T07:09:55.000Z (about 8 years ago)
- Last Synced: 2024-04-11T17:14:33.699Z (7 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
yii2-tagsinput
==============[![GitHub version](https://badge.fury.io/gh/efureev%2Fyii2-tagsinput.svg)](https://badge.fury.io/gh/efureev%2Fyii2-tagsinput) [![Build Status](https://travis-ci.org/efureev/yii2-tagsinput.svg?branch=master)](https://travis-ci.org/efureev/yii2-tagsinput) [![Dependency Status](https://gemnasium.com/badges/github.com/efureev/yii2-tagsinput.svg)](https://gemnasium.com/github.com/efureev/yii2-tagsinput) ![](https://reposs.herokuapp.com/?path=efureev/yii2-tagsinput) [![Code Climate](https://codeclimate.com/github/efureev/yii2-tagsinput/badges/gpa.svg)](https://codeclimate.com/github/efureev/yii2-tagsinput) [![Test Coverage](https://codeclimate.com/github/efureev/yii2-tagsinput/badges/coverage.svg)](https://codeclimate.com/github/efureev/yii2-tagsinput/coverage)
## without Model
```js
var inputUsers = $(''),
users = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('title'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch : {
url : '/users.json',
cache : false,
filter: function (list) {
return $.map(list, function (users) {
return {text: user.name};
});
}
}
});
hubs.initialize();inputUsers.tagsinput({
typeaheadjs: {
displayKey: 'text',
trimValue : true,
valueKey : 'text',
name : 'users',
source : users.ttAdapter()
}
});
```
## with Model```php
= $form->field($model, 'users', ['options' => [
'class' => 'form-group',
]])->widget(
\efureev\tagsinput\TagsInput::className(),
[
'preJS' => 'var users = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace("title"),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch : { url : "/users", cache : false,
filter: function (list) {
return $.map(list, function (user) {
return {text: user.name};
});
}
}
});',
'clientOptions' => [
'typeaheadjs' => [
'displayKey' => 'text',
'trimValue' => true,
'valueKey' => 'text',
'name' => 'users',
'source' => new \yii\web\JsExpression('users.ttAdapter()')
]
]
]
);
?>
```# Tests
`vendor/bin/phpunit`