PHPackages                             enigmatix/yii2-select - 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. [Framework](/categories/framework)
4. /
5. enigmatix/yii2-select

ActiveLibrary[Framework](/categories/framework)

enigmatix/yii2-select
=====================

Yii2 wrapper for the Select2 javascript widget

2.3.3(4y ago)0541MITPHPPHP &gt;=5.4.0

Since Jul 3Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (21)Used By (0)

yii2-select2
============

[](#yii2-select2)

Yii2 wrapper for the Select2 javascript widget.

This library makes the popular Select2 widget available for easy use in Yii2 projects within an ActiveForm. Please note that you cannot currently use this library to create a standalone Select2 widget without using an ActiveForm.

This widget is intentionally light on proprietary code, and instead favours existing Yii2 objects, classes and helpers where they are provided. It also provides a passthrough mechanism so you can use the full Select2 range of options without having to rely on support being manually added to this php widget.

REQUIREMENTS
------------

[](#requirements)

The minimum requirement by this library is:

1. your Web server supports PHP 5.4.0
2. you have Yii2 installed
3. You have correctly configured the composer fxp plugin as per the original Yii2 installation instructions

INSTALLATION
------------

[](#installation)

```
composer  require enigmatix/yii2-select "*"

```

GETTING STARTED
---------------

[](#getting-started)

```
use enigmatix/yii2select/Select2;

$dropdownList = ['Yes' => 'Yes', 'No'];

```

MULTIPLE SELECTION BOX
----------------------

[](#multiple-selection-box)

You can set additional attributes for the 'select' html element by passing values into the 'fieldOptions'

```

```

ADVANCED USAGE
--------------

[](#advanced-usage)

If you need to pass javascript expressions (functions or anything more complex than a string you will need to use an instance of yii\\web\\JsExpression to ensure the resulting config is encoded correctly. See  for more details: eg

```
$ajaxDataFunction = new JsExpression("function (term, page) {return {q: term,};}")

```

USING NATIVE SELECT2 FEATURES
-----------------------------

[](#using-native-select2-features)

As per the original Select2 docs found here: you can implement any of these features via the pluginOptions array. The array you build is passed through and JSON encoded as is, and will override any defaults within the widget itself.

CONTRIBUTIONS
-------------

[](#contributions)

If you would like to contribute to this codebase, please make a pull request or report an issue. The types of contributions that will be most useful are:

1. adding php abstractions for new features
2. refining the ajax support (not currently supported)
3. coding practice feedback and better customisability and usability

But of course all feedback is welcome :).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~96 days

Recently: every ~300 days

Total

20

Last Release

1771d ago

Major Versions

0.1.4 → 1.0.02016-07-03

1.0.2 → 2.0.02017-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/76cf569bbd0f2edd22cdbd1970f40990270c673292708bcb7d4fa6dd98c355e6?d=identicon)[enigmatix](/maintainers/enigmatix)

---

Top Contributors

[![enigmatix](https://avatars.githubusercontent.com/u/3024847?v=4)](https://github.com/enigmatix "enigmatix (29 commits)")

---

Tags

frameworkyii2widgetformselect2activeformactivefield

### Embed Badge

![Health badge](/badges/enigmatix-yii2-select/health.svg)

```
[![Health](https://phpackages.com/badges/enigmatix-yii2-select/health.svg)](https://phpackages.com/packages/enigmatix-yii2-select)
```

###  Alternatives

[kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

647.3M62](/packages/kartik-v-yii2-widget-activeform)[kartik-v/yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).

3279.7M191](/packages/kartik-v-yii2-widget-select2)[atk4/ui

Agile UI - Web Component Framework written in PHP

454540.1k32](/packages/atk4-ui)[kartik-v/yii2-widget-datepicker

Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)[kartik-v/yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)

1036.5M47](/packages/kartik-v-yii2-widget-datetimepicker)[tecnocen/yii2-formgenerator

Yii 2 Library to configure form generator

145.7k](/packages/tecnocen-yii2-formgenerator)

PHPackages © 2026

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