Le 06/02/2011 22:13, Michal_V a écrit :
Hi, What is the correct way to get action and route name in a template in Symfony2? (PHP and Twig syntax). Thanks
the Request object is available through the app variable which give access to the route name and the controller name.
Twig: app.request.attributes.get('_route')
PHP: $app->getRequest()->attributes->get('_route')

Same for the controller with _controller

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to