faryshta/yii2-jquery-tagsinput

用于 Jquery TagsInput 插件的 Yii2 小部件

1.0.0 2017-01-13 09:48 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:20:38 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

jQuery Tags Input (标签列表) 提供的 jQuery 插件的小部件(Yii2)

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

composer require --prefer-dist "faryshta/yii2-jquery-tagsinput:*"

或者将以下内容添加到您的 composer.json 文件的 require 部分:

"faryshta/yii2-jquery-tagsinput": "*"

require

使用方法

use faryshta\widgets\JqueryTagsInput;

// with ActiveForm
echo $form->field($model, 'attribute')->widget(JqueryTagsInput::className(), [
    // extra configuration
]);

// without ActiveForm and with model.
echo JqueryTagsInput::widget([
    'model' => $model,
    'attribute' => 'attribute',
    // extra configuration
]);

文档

此库没有定义任何新内容,小部件类与类 \yii\bootstrap\Widget 非常相似,该类可以用作小部件类的文档。

可以通过 $clientOptions 属性传递 JS 选项,并通过 $clientEvents 属性声明事件。有关 tagsInput 支持的所有选项和事件的文档,请参阅此处

许可

BSD 许可证(BSD)。有关更多信息,请参阅 许可证文件