PHPackages                             icron/yii2-select2-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. icron/yii2-select2-widget

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

icron/yii2-select2-widget
=========================

The select2 widget for Yii framework.

0.1.2(11y ago)02BSD-3-ClausePHP

Since Sep 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/icron/yii2-select2-widget)[ Packagist](https://packagist.org/packages/icron/yii2-select2-widget)[ Docs](https://github.com/vova07/yii2-select2-widget)[ RSS](/packages/icron-yii2-select2-widget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Yii2 select2 widget.
====================

[](#yii2-select2-widget)

[![Latest Version](https://camo.githubusercontent.com/75a957c8c59c81dbbe3f837643944a21742fab2c49078c7b2cb472f2d62086d4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f766f766130372f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/vova07/yii2-select2-widget/releases)[![Software License](https://camo.githubusercontent.com/b60331a2084501dc07cf6d6964c0da58dd005d89c45cf3b28b4b22b60f5ec00f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/82e3e93e0918753adee330f726116a92cbdf39baaacef55bc489b5b814627531/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f766f766130372f796969322d73656c656374322d7769646765742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/vova07/yii2-select2-widget)[![Coverage Status](https://camo.githubusercontent.com/7549658300df243dca5412856b813f809ec727ad9f09799eeb7708ec7935a386/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f766f766130372f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/vova07/yii2-select2-widget/code-structure)[![Quality Score](https://camo.githubusercontent.com/561029d92872fb12a0ce4d365cdcc7a6bc450949731a463edf6d08ff2fc3bc8b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f766f766130372f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/vova07/yii2-select2-widget)[![Total Downloads](https://camo.githubusercontent.com/aca64f46ac5dbf359a02a53efdefc3570ef3f729b40ce98676aacaba3aca7cd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766f766130372f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vova07/yii2-select2-widget)

Select2 widget is a wrapper of [Select2](http://ivaynberg.github.io/select2/) for Yii 2 framework.

Install
-------

[](#install)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist vova07/yii2-select2-widget "*"

```

or add

```
"vova07/yii2-select2-widget": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by:

```
use vova07\select2\Widget;

echo $form->field($model, 'field')->widget(Widget::className(), [
    'options' => [
        'multiple' => true,
        'placeholder' => 'Choose item'
    ],
    'settings' => [
        'width' => '100%',
    ],
    'items' => [
        'item1',
        'item2',
        ...
    ],
    'events' => [
        'select2-open' => 'function (e) { log("select2:open", e); }',
        'select2-close' => new JsExpression('function (e) { log("select2:close", e); }')
        ...
    ]
]);
```

Testing
-------

[](#testing)

```
$ phpunit
```

Further Information
-------------------

[](#further-information)

Please, check the [Select2](https://select2.github.io) documentation for further information about its configuration options.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Vasile Crudu](https://github.com/vova07)
- [All Contributors](../../contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Total

3

Last Release

4052d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f734ac9245d62145f90e4751aa6b47117b50f89002d90928b5244e5bc6a7152?d=identicon)[icron](/maintainers/icron)

---

Top Contributors

[![omnilight](https://avatars.githubusercontent.com/u/3306537?v=4)](https://github.com/omnilight "omnilight (10 commits)")[![vova07](https://avatars.githubusercontent.com/u/2714082?v=4)](https://github.com/vova07 "vova07 (8 commits)")

---

Tags

yii2extensionwidgetyiiselectyii 2select2select 2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/icron-yii2-select2-widget/health.svg)

```
[![Health](https://phpackages.com/badges/icron-yii2-select2-widget/health.svg)](https://phpackages.com/packages/icron-yii2-select2-widget)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
