symfony/AsseticBundle — pull request #250 by stof (2013-11-25 15:34:15+00:00)
Title: Refactored the controller to read variables from the request

This ensures that the variable values used to dump the asset are the one requested for this url instead of expecting that the value supplier is in the same state than when generating the url for the asset.
This assumption is already an issue for the default supplier: the symfony environment is likely to be the same, but the request locale is based on matching _locale, not locale. So the controller will generally use the en locale unless a listener changed it.
I discovered this issue when writing a custom value supplier which was not able to give me the right value at all (because the logic setting a special value in it was clearly not triggered in the request loading the asset).

The route definition and the Assetic target path generation already ensure that all variables are part of the request attribute after the route matching.