Skip to content

Commit e49377f

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: [Routing] Improving language, shortening twig code
2 parents ca98f0b + bdaed89 commit e49377f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

routing.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,15 +1612,11 @@ information in a controller via the ``Request`` object::
16121612
}
16131613
}
16141614

1615-
You can get this information in services too injecting the ``request_stack``
1616-
service to :doc:`get the Request object in a service </service_container/request>`.
1617-
In templates, use the :ref:`Twig global app variable <twig-app-variable>` to get
1618-
the current route and its attributes:
1619-
1620-
.. code-block:: twig
1621-
1622-
{% set route_name = app.current_route %}
1623-
{% set route_parameters = app.current_route_parameters %}
1615+
In services, you can get this information by
1616+
:doc:`injecting the RequestStack service </service_container/request>`.
1617+
In templates, use the :ref:`Twig global app variable <twig-app-variable>`
1618+
to get the current route name (``app.current_route``) and its parameters
1619+
(``app.current_route_parameters``).
16241620

16251621
.. versionadded:: 6.2
16261622

0 commit comments

Comments
 (0)