Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdaed89

Browse files
committed
Minor tweak
1 parent efa28c3 commit bdaed89

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

routing.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,14 +1603,11 @@ information in a controller via the ``Request`` object::
16031603
}
16041604
}
16051605

1606-
To get this information in a service, see :doc:`/service_container/request`.
1607-
In templates, you can use the :ref:`Twig global app variable <twig-app-variable>` to get
1608-
the current route and its attributes:
1609-
1610-
.. code-block:: twig
1611-
1612-
{% app.current_route %}
1613-
{% app.current_route_parameters %}
1606+
In services, you can get this information by
1607+
:doc:`injecting the RequestStack service </service_container/request>`.
1608+
In templates, use the :ref:`Twig global app variable <twig-app-variable>`
1609+
to get the current route name (``app.current_route``) and its parameters
1610+
(``app.current_route_parameters``).
16141611

16151612
.. versionadded:: 6.2
16161613

0 commit comments

Comments
 (0)