This bundle allow usage any version of library that you wish. Original lib uses as a package with forced version and original files is symlinked.
Just go to https://github.com/ivaynberg/select2 and check tags.
Set needed version and branch in version
and reference
of package.
// composer.json
{
"repositories": {
// ...
"ivaynberg/select2": {
"type": "package",
"package": {
"name": "ivaynberg/select2",
"version": "3.4.0",
"source": {
"url": "https://github.com/ivaynberg/select2.git",
"type": "git",
"reference": "tags/3.4.0"
}
}
}
},
// ...
"require": {
// ...
"fanforfun/select2-bundle": "dev-master"
}
}
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Fanforfun\Select2Bundle\FanforfunSelect2Bundle(),
// ...
);
}
$ php composer.phar update fanforfun/select2-bundle
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
Refer to the desired files in your twig/HTML template, e.g.
{% javascripts output='resources/js/*.js' '@FanforfunSelect2Bundle/Resources/public/select2.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
and i18n
{% javascripts output='resources/js/*.js' '@FanforfunSelect2Bundle/Resources/public/select2_locale_%YOUR_LANGUAGE%.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
and stylesheets
{% stylesheets filter='cssrewrite' output='resources/css/*.css' 'bundles/fanforfunleaflet/select2.css' %}
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
{% endstylesheets %}
Refer to the source code of the included files for license information