Question

How to exclude apply asset_version for images when we use assetic?

Was it helpful?

Solution

I know two options:

  1. Don't use asset helper, which won't make full URL and won't add undesired asset_version.
  2. Override helper method getUrl() in service named templating.helper.assets which is instance of Symfony\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
scroll top