{"$schema":"https://yii2-framework.github.io/docs/reference/reference.schema.json","schemaVersion":1,"package":"select2","title":"Select2","repository":"https://github.com/yii2-extensions/select2","ref":"main","commit":"9414fa906e64785996438a421942fb3585411ada","generatedAt":"2026-10-24","url":"https://yii2-framework.github.io/docs/extensions/select2/reference/","types":{"Yii2\\Extensions\\Select2\\Select2":{"kind":"class","url":"https://yii2-framework.github.io/docs/extensions/select2/reference/select2/","summary":"Renders a Select2 dropdown bound to a model attribute or a named input.","extends":"yii\\widgets\\InputWidget","implements":["yii\\base\\ViewContextInterface","yii\\base\\Configurable"],"properties":{"clientEvents":{"type":"array<string, string|yii\\web\\JsExpression>","default":"[]","description":"JavaScript handlers bound to the original select, keyed by event names."},"clientOptions":{"type":"array<string, mixed>|false","default":"[]","description":"Select2 options, or `false` to skip automatic initialization. `width` defaults to `100%` and `language` to the application language; the `bootstrap-5` and `bootstrap-6` themes register their stylesheets."},"items":{"type":"array<array-key, mixed>","default":"[]","description":"Items accepted by `yii\\helpers\\Html::dropDownList()`, including optgroups."}},"methods":{"run":{"signature":"public function run(): string","summary":"Renders the dropdown list and registers the Select2 client script.","return":{"type":"string","description":"Rendered `<select>` element HTML."}}},"inherited":{"properties":{"attribute":"yii\\widgets\\InputWidget","autoIdPrefix":"yii\\base\\Widget","behaviors":"yii\\base\\Component","field":"yii\\widgets\\InputWidget","id":"yii\\base\\Widget","model":"yii\\widgets\\InputWidget","name":"yii\\widgets\\InputWidget","options":"yii\\widgets\\InputWidget","value":"yii\\widgets\\InputWidget","view":"yii\\base\\Widget","viewPath":"yii\\base\\Widget"},"methods":{"__call":"yii\\base\\Component","__clone":"yii\\base\\Component","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\Component","__isset":"yii\\base\\Component","__set":"yii\\base\\Component","__unset":"yii\\base\\Component","afterRun":"yii\\base\\Widget","attachBehavior":"yii\\base\\Component","attachBehaviors":"yii\\base\\Component","beforeRun":"yii\\base\\Widget","begin":"yii\\base\\Widget","behaviors":"yii\\base\\Component","canGetProperty":"yii\\base\\Component","canSetProperty":"yii\\base\\Component","className":"yii\\base\\BaseObject","detachBehavior":"yii\\base\\Component","detachBehaviors":"yii\\base\\Component","end":"yii\\base\\Widget","ensureBehaviors":"yii\\base\\Component","getBehavior":"yii\\base\\Component","getBehaviors":"yii\\base\\Component","getId":"yii\\base\\Widget","getView":"yii\\base\\Widget","getViewPath":"yii\\base\\Widget","hasEventHandlers":"yii\\base\\Component","hasMethod":"yii\\base\\Component","hasModel":"yii\\widgets\\InputWidget","hasProperty":"yii\\base\\Component","init":"yii\\widgets\\InputWidget","off":"yii\\base\\Component","on":"yii\\base\\Component","render":"yii\\base\\Widget","renderFile":"yii\\base\\Widget","renderInputHtml":"yii\\widgets\\InputWidget","setId":"yii\\base\\Widget","setView":"yii\\base\\Widget","trigger":"yii\\base\\Component","widget":"yii\\base\\Widget"},"events":{"EVENT_INIT":"yii\\base\\Widget","EVENT_BEFORE_RUN":"yii\\base\\Widget","EVENT_AFTER_RUN":"yii\\base\\Widget"}}},"Yii2\\Extensions\\Select2\\Select2Asset":{"kind":"class","modifiers":["final"],"url":"https://yii2-framework.github.io/docs/extensions/select2/reference/select2asset/","summary":"Publishes Select2's full browser build and the translation matching the application language.","extends":"yii\\web\\AssetBundle","implements":["yii\\base\\Configurable"],"properties":{"css":{"default":"['css/select2.min.css']","description":"Default Select2 stylesheet."},"depends":{"default":"[\\yii\\web\\JqueryAsset::class]","description":"JQuery, required by Select2."},"js":{"default":"['js/select2.full.min.js']","description":"Full Select2 build; `publish()` appends the matching translation."},"sourcePath":{"default":"'@npm/select2/dist'","description":"Published distribution directory of the Select2 npm package."}},"methods":{"publish":{"signature":"public function publish(yii\\web\\AssetManager $am): void","summary":"Publishes the bundle and appends the exact regional translation, or else its base-language translation.","params":[{"name":"$am","type":"yii\\web\\AssetManager","description":"Asset manager that publishes the bundle."}],"return":{"type":"void"}}},"inherited":{"properties":{"basePath":"yii\\web\\AssetBundle","baseUrl":"yii\\web\\AssetBundle","cssOptions":"yii\\web\\AssetBundle","jsOptions":"yii\\web\\AssetBundle","publishOptions":"yii\\web\\AssetBundle"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\web\\AssetBundle","register":"yii\\web\\AssetBundle","registerAssetFiles":"yii\\web\\AssetBundle"}}},"Yii2\\Extensions\\Select2\\Select2WidgetAsset":{"kind":"class","modifiers":["final"],"url":"https://yii2-framework.github.io/docs/extensions/select2/reference/select2widgetasset/","summary":"Publishes the `yiiSelect2` jQuery plugin that initializes widgets, scopes their events, and mirrors ARIA state.","extends":"yii\\web\\AssetBundle","implements":["yii\\base\\Configurable"],"properties":{"depends":{"default":"[\\Yii2\\Extensions\\Select2\\Select2Asset::class]","description":"Select2 build and translation required by the integration script."},"js":{"default":"['select2.yii.js']","description":"Integration script that provides the `yiiSelect2` jQuery plugin."},"sourcePath":{"default":"__DIR__ . '/Assets'","description":"Published source directory of the packaged widget assets."}},"inherited":{"properties":{"basePath":"yii\\web\\AssetBundle","baseUrl":"yii\\web\\AssetBundle","css":"yii\\web\\AssetBundle","cssOptions":"yii\\web\\AssetBundle","jsOptions":"yii\\web\\AssetBundle","publishOptions":"yii\\web\\AssetBundle"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\web\\AssetBundle","publish":"yii\\web\\AssetBundle","register":"yii\\web\\AssetBundle","registerAssetFiles":"yii\\web\\AssetBundle"}}},"Yii2\\Extensions\\Select2\\Themes\\Select2BS5ThemeAsset":{"kind":"class","modifiers":["final"],"url":"https://yii2-framework.github.io/docs/extensions/select2/reference/themes/select2bs5themeasset/","summary":"Publishes the `bootstrap-5` Select2 theme stylesheet from the optional `select2-bootstrap-5-theme` package.","extends":"yii\\web\\AssetBundle","implements":["yii\\base\\Configurable"],"properties":{"css":{"default":"['select2-bootstrap-5-theme.min.css']","description":"Bootstrap 5 theme stylesheet."},"depends":{"default":"[\\Yii2\\Extensions\\Select2\\Select2Asset::class]","description":"Select2 bundle whose default stylesheet the theme extends."},"sourcePath":{"default":"'@npm/select2-bootstrap-5-theme/dist'","description":"Published distribution directory of the `select2-bootstrap-5-theme` npm package."}},"inherited":{"properties":{"basePath":"yii\\web\\AssetBundle","baseUrl":"yii\\web\\AssetBundle","cssOptions":"yii\\web\\AssetBundle","js":"yii\\web\\AssetBundle","jsOptions":"yii\\web\\AssetBundle","publishOptions":"yii\\web\\AssetBundle"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\web\\AssetBundle","publish":"yii\\web\\AssetBundle","register":"yii\\web\\AssetBundle","registerAssetFiles":"yii\\web\\AssetBundle"}}},"Yii2\\Extensions\\Select2\\Themes\\Select2BS6ThemeAsset":{"kind":"class","modifiers":["final"],"url":"https://yii2-framework.github.io/docs/extensions/select2/reference/themes/select2bs6themeasset/","summary":"Publishes the `bootstrap-6` Select2 theme stylesheet built on Bootstrap 6 design tokens.","extends":"yii\\web\\AssetBundle","implements":["yii\\base\\Configurable"],"properties":{"css":{"default":"['select2-bootstrap-6-theme.css']","description":"Packaged Bootstrap 6 theme stylesheet."},"depends":{"default":"[\\Yii2\\Extensions\\Select2\\Select2Asset::class]","description":"Select2 bundle whose default stylesheet the theme extends."},"sourcePath":{"default":"__DIR__ . '/../Assets'","description":"Published source directory of the packaged widget assets."}},"inherited":{"properties":{"basePath":"yii\\web\\AssetBundle","baseUrl":"yii\\web\\AssetBundle","cssOptions":"yii\\web\\AssetBundle","js":"yii\\web\\AssetBundle","jsOptions":"yii\\web\\AssetBundle","publishOptions":"yii\\web\\AssetBundle"},"methods":{"__call":"yii\\base\\BaseObject","__construct":"yii\\base\\BaseObject","__get":"yii\\base\\BaseObject","__isset":"yii\\base\\BaseObject","__set":"yii\\base\\BaseObject","__unset":"yii\\base\\BaseObject","canGetProperty":"yii\\base\\BaseObject","canSetProperty":"yii\\base\\BaseObject","className":"yii\\base\\BaseObject","hasMethod":"yii\\base\\BaseObject","hasProperty":"yii\\base\\BaseObject","init":"yii\\web\\AssetBundle","publish":"yii\\web\\AssetBundle","register":"yii\\web\\AssetBundle","registerAssetFiles":"yii\\web\\AssetBundle"}}}}}
