You can use parameters from
parameters.yml in routes. There are serveral use-cases when this may be useful.
Let’s say you want to localize your routes but you want to store the list of available locales only once. Then you could define a parameter in
Now you can use the parameter in your
Another use-case is routes based on a hostname. Instead of writing the hostname directly into
routing.yml you could use a parameter, as seen in the official documentation.
As fas as I know parameters only work for routes defined in YAML, XML or PHP. If it also works for annotation routes, please let me know.