maddoger / yii2-selectize
为 Yii 2 框架的 Selectize.js 小部件
v1.0.0
2015-10-12 14:36 UTC
Requires
- bower-asset/selectize: ~0.12
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-09-14 15:47:41 UTC
README
安装
安装此扩展的首选方式是通过 composer。
运行以下命令
$ composer require maddoger/yii2-selectize:~1.0
或者在您的 composer.json
文件的 require
部分添加以下内容
"maddoger/yii2-selectize": "~1.0"
to the require
section of your composer.json
file.
使用方法
Selectize 有许多配置选项。有关更多信息,请访问 Selectize 插件 网站。
文本输入小部件
要使用文本输入小部件,请将以下内容添加到视图中
use maddoger\widgets\SelectizeTextInput; echo SelectizeTextInput::widget([ 'name' => 'tags', 'value' => 'love, this, game', 'clientOptions' => [ // ... ], ]);
下拉列表小部件
要使用下拉列表小部件,请将以下内容添加到视图中
use maddoger\widgets\SelectizeDropDownList; echo SelectizeDropDownList::widget([ 'name' => 'tags', 'value' => ['love', 'this', 'game'], 'clientOptions' => [ // ... ], ]);