m-adamski / symfony-utils-bundle
A collection of additional tools for Symfony
Installs: 854
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- symfony/asset: ^4.1|^5.0
- symfony/console: ^4.1|^5.0
- symfony/framework-bundle: ^4.1|^5.0
- symfony/twig-bundle: ^4.1|^5.0
Requires (Dev)
- kint-php/kint: ^3.0
README
A collection of additional Symfony 4 tools that are small enough to create separate packages for them.
This bundle is compatible with Symfony 4.1 and Symfony 5.0. Symfony 3.4 compatibility abandoned.
Installation
This bundle can be installed by Composer:
$ composer require m-adamski/symfony-utils-bundle
What's included?
The package includes the following tools and helpers:
Name | Category | Description |
---|---|---|
AssetHashExtension | Twig Extension | The tool adds an MD5 checksum to the indicated resource |
SymfonyStyle | Console Symfony Style | Console Symfony Style with additional functionalities |
AssetHashExtension
An additional Twig function named asset_hash
is registered, which inserts the path to the indicated resource, and additionally inserts the MD5 checksum of the resource.
Example:
<script type="text/javascript" src="{{ asset_hash('assets/js/vendor.min.js') }}"></script>
The result of the function will be the path to the resource and its checksum.
<script type="text/javascript" src="/assets/js/vendor.min.js?78743b772817efd0530ca37eb28faf15"></script>
SymfonyStyle
A class that extends the capabilities of the core Symfony Console Style. It contains additional functions that will help in the presentation of information returned to the user.
License
MIT