alpixel/assetversionbundle

This bundle is used by our team to versionnize assets

v0.1.1 2016-08-25 09:18 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:12:17 UTC


README

Latest Stable Version

Since Symfony 3.3, you should use http://symfony.com/blog/new-in-symfony-3-3-manifest-based-asset-versioning

Installation

  • Install the package
composer require 'alpixel/assetversionbundle'
  • Update AppKernel.php

    <?php
    // app/AppKernel.php

    // ...
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...

                new Alpixel\Bundle\AssetVersionBundle\AlpixelAssetVersionBundle(),
            );

            // ...
        }

        // ...
    }

Configuration

Use gulp and gulp-rev or an other service to generate your assets revised files then call your asset in your template file using our twig extension :

<link rel="stylesheet" type="text/css" media="screen" href="{{ asset('css/vendor.min.css'|asset_version) }}" />