rbshubham/yii2-widget-tagsinput

A Yii2 wrapper widget for the Bootstrap Tags Input.

8.0 2020-03-30 09:44 UTC

This package is auto-updated.

Last update: 2025-06-29 01:49:48 UTC


README

Create a Bootstrap Tags Input Box

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

To install, either run

$ php composer.phar require rbshubham/yii2-widget-tagsinput

or add

"rbshubham/yii2-widget-tagsinput": "*"

to the require section of your composer.json file.

Usage

use shubham\tagsinput\TagsInput;

// Usage with ActiveForm and model
echo $form->field($model, 'tags')->widget(TagsInput::classname(), [
    "options"=>[
        // Input Options Here
    ],
    'pluginOptions'=>[
        // Refer to https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/#options
        // Enables clear all tags button
        'allowClear'=>true; // default true
    ],
    'pluginEvents'=>[
        // Refer to https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/
    ]
]);


// Without model & without ActiveForm
echo TagsInput::widget([
    'name' => 'tags',
]);

For more details, visit: http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/