Search by

yii2-extensions / selectize

terabytesoftw

Selectize widgets for Yii2 with ActiveForm, remote JSON choices, Bootstrap 5 styling, and lifecycle cleanup.

Package info

github.com/yii2-extensions/selectize

Homepage

Documentation

Language:JavaScript

pkg:composer/yii2-extensions/selectize

Statistics

Installs: 204

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

0.2.1 2026-10-23 09:36 UTC

README

Yii Framework

Selectize widget


PHPUnit Mutation Testing PHPStan Security

Selectize selects and text inputs for Yii models and forms
Bootstrap 5 styling, multiple values, remote JSON choices and lifecycle cleanup

Quick start

Installation

Configure the consuming application's plugins and asset aliases with the installation guide, then install the documented branch:

composer require --prefer-dist yii2-extensions/selectize:^0.2

The native asset manager installs the published frontend assets without Node.js or a JavaScript build. Keep an existing application manager when it already supplies those assets.

Basic usage

Place this in a Yii view and associate the input with a visible label:

use yii\helpers\Html;
use yii2\extensions\selectize\Selectize;

echo Html::label('Category', 'category');
echo Selectize::widget(
    [
        'name' => 'category',
        'value' => 'yii',
        'items' => ['php' => 'PHP', 'yii' => 'Yii'],
        'options' => ['id' => 'category', 'prompt' => 'Choose a category'],
        'clientOptions' => ['maxItems' => 1],
    ],
);

Item keys are submitted values. To bind a model attribute in an ActiveForm:

use yii2\extensions\selectize\Selectize;

echo $form->field($model, 'tags')
    ->widget(
        Selectize::class,
        [
            'items' => ['php' => 'PHP', 'yii' => 'Yii'],
            'options' => ['multiple' => true],
            'clientOptions' => ['plugins' => ['remove_button']],
        ],
    );

The model must validate tags as an array; browser options do not authorize submitted values. See model validation for cleared fields and rejected submissions.

Documentation

Practical guides and examples for widget configuration, forms and remote choices.

The guides and the API reference generated from the PHPDoc in src/ are published at https://yii2-framework.github.io/docs/extensions/selectize/.

AI assistance

AI agents: read the documentation index and fetch the Markdown version of a page by appending index.md to its URL. The AI agents guide covers skill installation, client setup and verification.

The hosted documentation covers Yii 22.0. If it does not match the installed revision or is unavailable, use the repository guides, the skill source, the source PHPDoc and the changelog.

Package information

PHP Yii 2.0.55+ Yii 22.0.x Latest Stable Version Total Downloads

Project status

Codecov PHPStan Level 7 Quality ECS

Our social networks

Follow on X Follow on Facebook Join our Subreddit Join on Telegram

License

License

The extension uses BSD-3-Clause. Bundled third-party JavaScript retains its Apache-2.0 and MIT terms; see the third-party runtime notices.