Skip to content

11ya/select2-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Current Version

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.

Installation

Add bundle to your composer.json file

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"
    }
}

Add bundle to your application kernel

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Fanforfun\Select2Bundle\FanforfunSelect2Bundle(),
        // ...
    );
}

Download the bundle using Composer

$ php composer.phar update fanforfun/select2-bundle

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

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 %}

Licenses

Refer to the source code of the included files for license information

References

  1. http://symfony.com/

  2. https://github.com/ivaynberg/select2

  3. http://ivaynberg.github.io/select2/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages