yii2-extensions / selectize
Selectize widgets for Yii2 with ActiveForm, remote JSON choices, Bootstrap 5 styling, and lifecycle cleanup.
Package info
github.com/yii2-extensions/selectize
Language:JavaScript
pkg:composer/yii2-extensions/selectize
Requires
- php: >=8.3
- php-forge/foxy: ^0.4
- yiisoft/yii2: ~2.0.55 || ^22.0@dev
Requires (Dev)
- maglnet/composer-require-checker: ^4.7
- php-forge/support: ^0.1
- phpunit/phpunit: ^10.5
- roave/infection-static-analysis-plugin: ^1.34
- symplify/easy-coding-standard: ^13.3
- yii2-extensions/phpstan: ^0.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 09:41:19 UTC
README
Selectize widget
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.
- ๐ Installation Guide: packages, managers and asset aliases.
- โ๏ธ Configuration Guide: model values, remote data and rendering.
- ๐ก Usage Examples: validated, multiple, text and remote fields.
- ๐ Events, Accessibility and Lifecycle
- ๐ Upgrade Guide
- ๐งช Testing Guide
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.
- ๐ค
yii2-selectizeskill: Selectize widgets. - ๐งญ
yii2-frameworkskill: Yii 22.0 application conventions.
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
Project status
Our social networks
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.