Selectize
Bu içerik henüz dilinizde mevcut değil.
Selectize selects and text inputs for Yii models and forms
Bootstrap 5 styling, multiple values, remote JSON choices and lifecycle cleanup
Quick start
Section titled “Quick start”Installation
Section titled “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.2The 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
Section titled “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
Section titled “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
Section titled “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.
Our social networks
Section titled “Our social networks”Follow on X Follow on Facebook Join our Subreddit Join on Telegram
License
Section titled “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.
Package
Section titled “Package”- Source code and issues: yii2-extensions/selectize. Star the repository if the package is useful to you.
- Composer package: yii2-extensions/selectize.
- Changelog: CHANGELOG.md.