php - Access global parameters from route condition expressions in Symfony -
php - Access global parameters from route condition expressions in Symfony -
i'm trying access app-wide symfony parameters (defined in app/config/parameters.yml) look in route status (documentation).
i tried luck inserting parameter within percentage signs , through function "parameter" (as described di here), both no avail.
here illustration parameter function:
example_route: path: /example/{_locale} condition: "request.getlocale() in parameter('locales_array')" defaults: _controller: "acmeexamplebundle:example:index" _locale: %locales_default% i'm getting:
syntaxerror - function "parameter" not exist around position 24.
there way access parameters routing status expressions?
i opened pr @ https://github.com/symfony/symfony/pull/12869 2.7 version, until it's done , shipped have utilize own extended version if urlmatcher in project in you'll need add together container functions provider , inject container in "variables" argument of expressionlanguage#evaluate you'll able access parameters , services.
you can @ pr hint how it, i'll write more in detail if need later.
php symfony2 symfony2.4 symfony-routing
Comments
Post a Comment