php - Access global parameters from route condition expressions in Symfony -


I'm trying to reach an app-wide simulation parameters (defined by app / config / parameter.imple) in an expression Am a way bet ()

I tried to put my destiny in the parameter within percent signals and the function "Parameters" (described for DI), both have no effect.

Example with parameter function:

  example_route: path: / example / {_ locale} condition: "in the request.getLocale () parameter ('locales_array')" Default: _controller: "AcmeExampleBundle: Example: Index" _locale:% locales_default%  


I'm getting:

< Strong> Syntax Error - The status "parameter" is not present around position 24.


Is there a way to access parameters from routing condition expressions?

I opened a PR for version 2.7, as long as it has been sent and sent you to your project In order to use UrlMatcher, you will need to use your own extended version in which you will need to add the container function provider and in the "variable" argument of the expression language # need to contain a container so that you can enable the parameters and services Reached by For.

You can see the PR how to do it, I will write it in more detail about writing later.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -