PHPackages                             xpbl4/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. xpbl4/yii2-select2-widget

ActiveYii2-extension

xpbl4/yii2-select2-widget
=========================

The Select2 widget for Yii framework.

v0.1.3(2y ago)046BSD-3-ClauseCSSCI failing

Since Jun 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Xpbl4/yii2-select2-widget)[ Packagist](https://packagist.org/packages/xpbl4/yii2-select2-widget)[ Docs](https://github.com/Xpbl4/yii2-select2-widget)[ RSS](/packages/xpbl4-yii2-select2-widget/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Yii2 Select2 widget
===================

[](#yii2-select2-widget)

[![Latest Version](https://camo.githubusercontent.com/f4ad3f19f6e04f10b2dfc33fe521c09afe706ec3af08fe99fbddd6db93b3fdee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f5870626c342f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/Xpbl4/yii2-select2-widget/releases)[![Software License](https://camo.githubusercontent.com/b60331a2084501dc07cf6d6964c0da58dd005d89c45cf3b28b4b22b60f5ec00f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/e203f77093721880ee32b47be8312245fdb59916abaa9501df6e856f630c14b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5870626c342f796969322d73656c656374322d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Xpbl4/yii2-select2-widget)

Select2 widget is a wrapper of [Select2](https://select2.org/) for Yii 2 framework.

Installation
------------

[](#installation)

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

Either run

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

```

or add

```
"xpbl4/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 xpbl4\select\Select2;

echo $form->field($model, 'field')->widget(Select2::className(), [
    'items' => [
        'item1',
        'item2',
        ...
    ],
    'options' => [
        'multiple' => true,
        'placeholder' => 'Choose item'
    ],
    'pluginOptions' => [
        'width' => '100%',
    ],
    'pluginEvents' => [
        '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.org/) documentation for further information about its configuration options.

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Serge Mashkov](https://github.com/Xpbl4)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~568 days

Total

3

Last Release

1029d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b25027522ebc5202b9a37b3760967bf84b7d5a8dd5f80f2780a71a1c23e892b4?d=identicon)[xpbl4](/maintainers/xpbl4)

---

Top Contributors

[![Xpbl4](https://avatars.githubusercontent.com/u/717048?v=4)](https://github.com/Xpbl4 "Xpbl4 (14 commits)")[![AdminASSE](https://avatars.githubusercontent.com/u/116835194?v=4)](https://github.com/AdminASSE "AdminASSE (2 commits)")

---

Tags

yii2extensionwidgetyiiselectyii 2select2select 2

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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