2

Symfony2 tip: Get current route name in twig template

Posted December 5th, 2011 in Snippets by Metod
  1. {{ app.request.attributes.get(‘_route’) }}

Enjoy! ;)

2 Responses so far.

  1. Ivo Azirjans says:

    This does not work when forwarded.

  2. Metod says:

    This should be expected, since you are still on the same url – thus on the same route name.