PHPackages                             anggiaj/eselect2 - 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. anggiaj/eselect2

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

anggiaj/eselect2
================

ESelect2 is a widget extension for Yii framework. This extension is a wrapper for Select2 Jquery plugin (https://github.com/ivaynberg/select2).

02.3k1JavaScript

Since Jul 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Digizijn/ESelect2)[ Packagist](https://packagist.org/packages/anggiaj/eselect2)[ RSS](/packages/anggiaj-eselect2/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ESelect2 is a widget extension for Yii framework. This extension is a wrapper for Select2 Jquery plugin ().

Requirements
------------

[](#requirements)

- Yii 1.1 or above (tested on 1.1.10)

Usage
-----

[](#usage)

- Extract the downloaded file to your application extensions directory
- Use it at your view

Examples
--------

[](#examples)

Basic
-----

[](#basic)

```
$this->widget('ext.select2.ESelect2', array(
 'name' => 'selectInput',
	'data' => array(
		0 => 'Nol',
		1 => 'Satu',
		2 => 'Dua',
	)
));
```

Working with model
------------------

[](#working-with-model)

```
$this->widget('ext.select2.ESelect2', array(
	'model' => $model,
	'attribute' => 'attrName',
	'data' => array(
		0 => 'Nol',
		1 => 'Satu',
		2 => 'Dua',
	),
));
```

Using selector
--------------

[](#using-selector)

```
$tags = array('Satu', 'Dua', 'Tiga');
echo CHtml::textField('test', '', array('id' => 'test'));
$this->widget('ext.select2.ESelect2', array(
	'selector' => '#test',
	'options' => array(
		'tags' => $tags,
	),
));
```

Using `optgroup`
----------------

[](#using-optgroup)

```
$data = array(
	'one' => array(
		'1' => 'Satu',
		'2' => 'Dua',
		'3' => 'Tiga',
	),
	'two' => array(
		'4' => 'Sidji',
		'5' => 'Loro',
		'6' => 'Telu',
	),
	'three' => array(
		'7' => 'Hiji',
		'8' => 'Dua',
		'9' => 'Tilu',
	),
);

$this->widget('ext.select2.ESelect2', array(
	'name' => 'testing',
	'data' => $data,
));
```

Multiple data
-------------

[](#multiple-data)

```
$data = array(
	'1' => 'Satu',
	'2' => 'Dua',
	'3' => 'Tiga',
);

$this->widget('ext.select2.ESelect2', array(
	'name' => 'ajebajeb',
	'data' => $data,
	'htmlOptions' => array(
		'multiple' => 'multiple',
	),
));
```

Placeholder
-----------

[](#placeholder)

```
$this->widget('ext.select2.ESelect2', array(
	'name' => 'asik2x',
	'data' => $data,
	'options' => array(
		'placeholder' => Yii::t('select2', 'Keren ya?'),
		'allowClear' => true,
	),
));
```

Working with remote data
------------------------

[](#working-with-remote-data)

```
echo CHtml::textField('movieSearch', '', array('class' => 'span5'));
$this->widget('ext.select2.ESelect2', array(
	'selector' => '#movieSearch',
	'options' => array(
		'placeholder' => 'Search a movie',
		'minimumInputLength' => 1,
		'ajax' => array(
			'url' => 'http://api.rottentomatoes.com/api/public/v1.0/movies.json',
			'dataType' => 'jsonp',
			'data' => 'js: function(term,page) {
					return {
						q: term,
						page_limit: 10,
						apikey: "e5mnmyr86jzb9dhae3ksgd73" // Please create your own key!
					};
				}',
			'results' => 'js: function(data,page){
				return {results: data.movies};
			}',
		),
		'formatResult' => 'js:function(movie){
			var markup = "";
			if (movie.posters !== undefined && movie.posters.thumbnail !== undefined) {
				markup += "";
			}
			markup += "" + movie.title + "";
			if (movie.critics_consensus !== undefined) {
				markup += "" + movie.critics_consensus + "";
			}
			else if (movie.synopsis !== undefined) {
				markup += "" + movie.synopsis + "";
			}
			markup += "";
			return markup;
		}',
		'formatSelection' => 'js: function(movie) {
			return movie.title;
		}',
	),
));
```

Resources
---------

[](#resources)

- Jquery extension URL:
-
- Demo
- Yii extension URL:
-
-

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/12dc064bfd4912554c732937503e5be9e371ce2b9e4264ec938af3c480905dc6?d=identicon)[RdeWilde](/maintainers/RdeWilde)

---

Top Contributors

[![anggiaj](https://avatars.githubusercontent.com/u/367079?v=4)](https://github.com/anggiaj "anggiaj (31 commits)")[![RdeWilde](https://avatars.githubusercontent.com/u/184016?v=4)](https://github.com/RdeWilde "RdeWilde (2 commits)")[![KingYes](https://avatars.githubusercontent.com/u/902548?v=4)](https://github.com/KingYes "KingYes (2 commits)")[![nineinchnick](https://avatars.githubusercontent.com/u/795177?v=4)](https://github.com/nineinchnick "nineinchnick (2 commits)")[![gabrieljenik](https://avatars.githubusercontent.com/u/4942495?v=4)](https://github.com/gabrieljenik "gabrieljenik (1 commits)")[![BjoernAkAManf](https://avatars.githubusercontent.com/u/833043?v=4)](https://github.com/BjoernAkAManf "BjoernAkAManf (1 commits)")[![bravoman](https://avatars.githubusercontent.com/u/1729802?v=4)](https://github.com/bravoman "bravoman (1 commits)")[![dudareviv](https://avatars.githubusercontent.com/u/1499027?v=4)](https://github.com/dudareviv "dudareviv (1 commits)")

### Embed Badge

![Health badge](/badges/anggiaj-eselect2/health.svg)

```
[![Health](https://phpackages.com/badges/anggiaj-eselect2/health.svg)](https://phpackages.com/packages/anggiaj-eselect2)
```

###  Alternatives

[bref/dev-server

Local development server for serverless web apps

3612.5k](/packages/bref-dev-server)

PHPackages © 2026

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