PHPackages                             stinger-soft/select2-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. stinger-soft/select2-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

stinger-soft/select2-bundle
===========================

Symfony2 bundle for wrapping the famous select2 jquery plugin by @ivaynberg

4.0.3.1(8y ago)010MITJavaScriptPHP &gt;=5.3.2

Since May 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Stinger-Soft/select2-bundle)[ Packagist](https://packagist.org/packages/stinger-soft/select2-bundle)[ Docs](http://github.com/stinger-soft/select2-bundle)[ RSS](/packages/stinger-soft-select2-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (15)Used By (0)

Select2 Bundle for Symfony2
===========================

[](#select2-bundle-for-symfony2)

Current Version
---------------

[](#current-version)

[Select2 4.0.3](https://select2.github.io/)

Including Bugfix [select2/select2#4398 (comment)](https://github.com/select2/select2/issues/4398#issuecomment-281721604)

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

[](#installation)

### Add bundle to your composer.json file

[](#add-bundle-to-your-composerjson-file)

```
// composer.json

{
    "require": {
        // ...
        "stinger-soft/select2-bundle": "dev-master"
    }
}
```

### Or, if you prefer, choose a specific version

[](#or-if-you-prefer-choose-a-specific-version)

```
// composer.json

{
    "require": {
        // ...
        "stinger-soft/select2-bundle": "4.0.3.1"
    }
}
```

### Add bundle to your application kernel

[](#add-bundle-to-your-application-kernel)

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Pinano\Select2Bundle\PinanoSelect2Bundle(),
        // ...
    );
}
```

### Download the bundle using Composer

[](#download-the-bundle-using-composer)

```
$ php composer.phar update pinano/select2-bundle
```

### Install assets

[](#install-assets)

Given your server's public directory is named "web", install the public vendor resources

```
$ php app/console assets:install web
```

Optionally, use the --symlink attribute to create links rather than copies of the resources

```
$ php app/console assets:install --symlink web
```

Usage
-----

[](#usage)

Once all the resources are in place you can edit any of your twig views or layouts to include the Select2 javascript files.

Select2 optionally supports multiple languages by simply including the right language javascript file (`i18n/es.js`, `i18n/fr.js`, etc.) after `select2.js`. In the following example we are loading the Spanish locale.

Note: Select2 requires the jQuery library.

```
{% block javascripts %}

    {% javascripts
        ...
        '@PinanoSelect2Bundle/Resources/public/js/select2.min.js'
        '@PinanoSelect2Bundle/Resources/public/js/i18n/es.js'
        ...
        %}

    {% endjavascripts %}
{% endblock %}
```

Then you will want to load the css resources so your select elements look nice:

```
{% block stylesheets %}
    {% stylesheets filter='cssrewrite'
      ...
      'bundles/pinanoselect2/css/select2.css'
      ...
    %}

    {% endstylesheets %}
{% endblock %}
```

Note: See [kriswallsmith/assetic#53](https://github.com/kriswallsmith/assetic/issues/53) for known limitations of assetic with CSS referencing.

I usually follow a simple inheritance schema when it comes to designing twig templates. That is, I have an app/Resources/views/base.html.twig file that I use as a site-wide template. Then, inside every bundle I have my own Resources/views/layout.html.twig file that extends the base template. Depending on the kind of application I'm designing I can place the Bootstrap stuff in the site-wide or the bundle-wide template. Then every view of a given bundle will extend the corresponding bundle layout.html.twig file, which in turn extends the site-wide template.

The folks at Sensio Labs have already covered this approach and you can check it in their [documentation](http://twig.sensiolabs.org/doc/templates.html#template-inheritance).

Licenses
--------

[](#licenses)

I do not own Select2 files at all, I'm just providing a Bundle package to easy-install them all. Refer to the source code of the included files from Select2 for license information.

References
----------

[](#references)

1.
2.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~138 days

Recently: every ~194 days

Total

12

Last Release

3218d ago

Major Versions

3.4.5 → 4.0.02015-04-30

v3.x-dev → 4.0.12016-02-03

### Community

Maintainers

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

---

Top Contributors

[![pinano](https://avatars.githubusercontent.com/u/1442754?v=4)](https://github.com/pinano "pinano (29 commits)")[![PastisD](https://avatars.githubusercontent.com/u/442023?v=4)](https://github.com/PastisD "PastisD (2 commits)")[![gaetan-petit](https://avatars.githubusercontent.com/u/851486?v=4)](https://github.com/gaetan-petit "gaetan-petit (1 commits)")

---

Tags

bundlejqueryselect2

### Embed Badge

![Health badge](/badges/stinger-soft-select2-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/stinger-soft-select2-bundle/health.svg)](https://phpackages.com/packages/stinger-soft-select2-bundle)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M315](/packages/twig-extra-bundle)[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)[endroid/qr-code-bundle

Endroid QR Code Bundle

32110.6M17](/packages/endroid-qr-code-bundle)[qossmic/rich-model-forms-bundle

Provides additional data mapper options that ease the use of the Symfony Form component with rich models.

218278.7k](/packages/qossmic-rich-model-forms-bundle)[lexik/currency-bundle

This Symfony2 bundle provide a service and a Twig extension to convert and display currencies.

63234.9k1](/packages/lexik-currency-bundle)[yellowskies/qr-code-bundle

Symfony Barcode &amp; QR Code Generator Bundle with Twig extension

36682.9k](/packages/yellowskies-qr-code-bundle)

PHPackages © 2026

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