apnet/jquery

jQuery for AsseticImporter

Installs: 477

Dependents: 2

Watchers: 3

Language: PHP

2.1.3-BETA1 2015-04-20 08:36 UTC

README

Installation

Add requirements to composer.json:

{
  "require" : {
    "apnet/jquery" : "~2.1"
  }
}

Configurations

Register ApnetAsseticImporterBundle bundle in the AppKernel.php file

// ...other bundles ...
$bundles[] = new Apnet\AsseticImporterBundle\ApnetAsseticImporterBundle();

Add jQuery importer to services.yml

services:
    apnet.assetic.importer.jquery:
        parent: assetic.importer_path
        arguments:
            - %kernel.root_dir%/../vendor/apnet/jquery/app/Resources/assets/dist
            - jquery
        tags:
            - { name: apnet.assetic.config_mapper }

Twig

To include jQuery into Twig template use imported_asset function:

<script type="text/javascript" src="{{ imported_asset('jquery/jquery.min.js') }}"></script>