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/Leaflet/Leaflet and check tags.
Set needed version and branch in version
and reference
of package.
// composer.json
{
"repositories": {
// ...
"leaflet/leaflet": {
"type": "package",
"package": {
"name": "leaflet/leaflet",
"version": "0.5.1",
"source": {
"url": "https://github.com/Leaflet/Leaflet.git",
"type": "git",
"reference": "tags/v0.5.1"
}
}
}
},
// ...
"require": {
// ...
"fanforfun/leaflet-bundle": "dev-master"
}
}
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Fanforfun\LeafletBundle\FanforfunLeafletBundle(),
// ...
);
}
$ php composer.phar update fanforfun/leaflet-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' '@FanforfunLeafletBundle/Resources/public/js/leaflet.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
or obfuscated version
{% javascripts output='resources/js/*.js' '@FanforfunLeafletBundle/Resources/public/js/leaflet.min.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
And stylesheets:
{% stylesheets filter='cssrewrite' output='resources/css/*.css' 'bundles/fanforfunleaflet/css/leaflet.css' %}
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
{% endstylesheets %}
{% stylesheets filter='cssrewrite' output='resources/css/*.css' 'bundles/fanforfunleaflet/css/leaflet.ie.css' %}
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
{% endstylesheets %}
Refer to the source code of the included files for license information