承接 wdmg/yii2-tagsinput 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wdmg/yii2-tagsinput

最新稳定版本:1.0.4

Composer 安装命令:

composer require wdmg/yii2-tagsinput

包简介

Bootstrap3 tags input widget for Yii2

README 文档

README

Yii2 Downloads Packagist Version Progress GitHub license

Yii2 TagsInput

Tags input widget for Yii2

Requirements

Installation

To install the widget, run the following command in the console:

$ composer require "wdmg/yii2-tagsinput"

Usage

Example of standalone widget:

<?php

use wdmg\widgets\TagsInput;
...

echo TagsInput::widget([
    'model' => $model,
    'attribute' => 'post_tags',
    'options' => [
        'class' => 'form-control'
    ],
    'pluginOptions' => [
        'minInput' => 2,
        'maxTags' => 100
    ]
]);

?>

Example of use with ActiveForm:

<?php

use wdmg\widgets\TagsInput;
...

$form = ActiveForm::begin();
...

echo $form->field($model, 'tags')->widget(TagsInput::class, [
    'options' => [
        'id' => 'post-tags',
        'class' => 'form-control',
        'placeholder' => 'Type your tags here...'
    ],
    'pluginOptions' => [
        'autocomplete' => '//example.com/api/',
        'format' => 'json',
        'minInput' => 2,
        'maxTags' => 100
    ]
]);
...

ActiveForm::end();

?>

Options

TagsInput extends InputWidget so you can use any options available for this widget. In addition, you can use these custom options if necessary:

Name Type Default Description
options array ['class' => 'form-control'] Standard options for the input widget.
pluginOptions array array() Plugin TagsInput options passed to js. Read more here (https://github.com/wdmg/bootstrap-tagsinput).
items array ['value' => 'Label'] Array values with labels.

Status and version [ready to use]

  • v.1.0.4 - Fixed widget ID and init after Pjax reloading
  • v.1.0.3 - Up to date dependencies
  • v.1.0.2 - Fixed deprecated class declaration and added README.md

统计信息

  • 总下载量: 3.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-26