Exclude asset_version for image
Question
How to exclude apply asset_version for images when we use assetic?
Solution
I know two options:
- Don't use
asset
helper, which won't make full URL and won't add undesiredasset_version
. - Override helper method
getUrl()
in service namedtemplating.helper.assets
which is instance ofSymfony\Component\Templating\Helper\CoreAssetsHelper
by creating a new service extending it (for example) where you write your own logic for such rules.
If you do it second way then please share the code, in case somebody else will want to implement it later.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow