I am very new to Symfony2, and I need to check the current route in TWIG so that I can display a submenu in a template that looks like this:
{% render "CPAdminBundle:Messages:sidebarMenu" %}
{% render "CPAdminBundle:Readings:sidebarMenu" %}
In sidebar templates, I tried using the following, but it throws an error:
path(app.request.attributes.get('_route'))
What is the right way to do what I'm trying to accomplish?
source
share