A view element on my page depends on a route parameter and will render something if a route parameter is present. Is it possible to access Route parameter in twig template directly?
For example:
TestBundle_testroute: pattern: /{name} defaults: { _controller: TestBundle:Default:test, name: defaultname }
I would like to be directly able to access “name” route parameter in Twig. Something like:
{{ routing.name }}
You can achieve it like this:
{{ app.request.get('name') }}
1.4m articles
1.4m replys
5 comments
56.9k users