Installation
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
$ composer require maddoger/yii2-selectize:~1.0
or add, (*3)
"maddoger/yii2-selectize": "~1.0"
to the require
section of your composer.json
file., (*4)
Usage
Selectize has lots of configuration options. For further information, please check the Selectize plugin website., (*5)
Text input widget
To use text input widget add the following to the view, (*6)
use maddoger\widgets\SelectizeTextInput;
echo SelectizeTextInput::widget([
'name' => 'tags',
'value' => 'love, this, game',
'clientOptions' => [
// ...
],
]);
To use dropdown list widget add the following to the view, (*7)
use maddoger\widgets\SelectizeDropDownList;
echo SelectizeDropDownList::widget([
'name' => 'tags',
'value' => ['love', 'this', 'game'],
'clientOptions' => [
// ...
],
]);