Download the PHP package m1/twig-asset-rev-extension without Composer
On this page you can find all versions of the php package m1/twig-asset-rev-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download m1/twig-asset-rev-extension
More information about m1/twig-asset-rev-extension
Files in m1/twig-asset-rev-extension
Package twig-asset-rev-extension
Short Description Twig Asset Rev Extension adds a asset_rev twig filter so you can use asset revisioning from files, perfect for use with gulp-rev or grunt-rev
License MIT
Homepage https://github.com/M1/:package_name
Informations about the package twig-asset-rev-extension
TwigAssetRevExtension
Twig Asset Rev Extension adds a asset_rev
twig filter so you can use asset revisioning from files, perfect for use
and tested with gulp-rev
/gulp-rev-all
or grunt-rev
Requirements
TwigAssetRevExtension
requires PHP version 5.3+
.
Install
Via Composer
Usage
TwigAssetRevExtension
works like other twig extensions, just add the extension using $twig->addExtension()
.
example.twig
:
rev-manifest.json
:
Symfony usage
You can register the extension automatically in Symfony via app/config/services.yml
.
Setup
Parameters
assets
The path to the JSON file, or the array of assets and rev'd assets, an example:
If using gulp-rev
or gulp-rev-all
this is just the contents of rev-manifest.json
- parsing the json file with
json_decode(file_get_contents('rev-manifest.json'), true);
. You should probably cache this result though so you don't have to
read the file every request.
minified
When true
this means that TwigAssetRevExtension
will pass back minified assets if they're available. Twig debug mode
or Silex debug mode override this and it won't pass back minified assets in development.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Miles Croxford
- All Contributors
License
The MIT License (MIT). Please see License File for more information.