PHPackages                             pinano/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pinano/select2-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pinano/select2-bundle
=====================

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

v4.0.3(9y ago)18199.4k↓39.6%9[2 issues](https://github.com/pinano/select2-bundle/issues)1MITJavaScriptPHP &gt;=5.3.2

Since May 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/pinano/select2-bundle)[ Packagist](https://packagist.org/packages/pinano/select2-bundle)[ Docs](http://github.com/pinano/select2-bundle)[ RSS](/packages/pinano-select2-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (13)Used By (1)

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

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

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

[](#current-version)

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

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

[](#installation)

### Add bundle to your composer.json file

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

```
// composer.json

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

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

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

```
// composer.json

{
    "require": {
        // ...
        "pinano/select2-bundle": "4.0.3"
    }
}
```

### 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

39

—

LowBetter than 84% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~127 days

Recently: every ~141 days

Total

11

Last Release

3517d ago

Major Versions

3.4.5 → 4.0.02015-04-30

3.x-dev → 4.0.12016-02-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eea1f6359180db9cda32603cea6dc91ff7a68b58dc41f0e4ddcfc9ea0580f4a?d=identicon)[fergardi](/maintainers/fergardi)

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

---

Top Contributors

[![pinano](https://avatars.githubusercontent.com/u/1442754?v=4)](https://github.com/pinano "pinano (30 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/pinano-select2-bundle/health.svg)

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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