Right now I have :
templating:
engines: ['twig']
assets_version: ~
assets_version_format: %%s?%%s
And My javascripts tag
assetic:
debug: false
use_controller: false
read_from: %kernel.root_dir%/../web
write_to: %kernel.root_dir%/../web
.....
And guess what ? the name of the files never changes each time I run
php app/console assetic:dump --env=prod
I’ve followed the documentation without any success…
What i clearly don’t want is to specify manually the version of the assets in the config.yml. I want the name of the file OR a special query string generated automatically when the file compiled file has changed (or when i run the dump command)
Thanks
The
assets_versionparam does not control the name of the files that assetic generates. It is just a query param that is added to the url of the asset when you output it using theasset()function in twig. This generates urls like this:where v2 is the value of the
assets_versionparam. The problem is that you must manually update this value everytime you update your assets as there is no automatic way to do that.As for the name of the assetic file not changing when you rerun assetic:dump, this is a known issue. But you are lucky! Just three days ago a new pull request was merged into the assetic code which just provides this functionality :-). So, you just need to update to the latest latest version of assetic and you will get this feature working.