The GulpRevBundle adds a simple twig filter for files revisioned with gulp-rev.
To install GulpRevBundle run the following command:
$ php composer.phar require sayme/gulp-rev-bundle
Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Sayme\GulpRevBundle\SaymeGulpRevBundle(),
);
}
Below are the default settings. You can change them to whatever you prefer.
# app/config/config.yml
sayme_gulp_rev:
manifest_path: "%kernel.root_dir%/Resources/rev-manifest.json"
build_dir: "build"
Add the asset_rev filter to your twig asssets.
<script src="{{ asset('js/app.js'|asset_rev) }}"></script>