Skip to content

Commit 6b094a4

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [Routing] Improving language, shortening twig code
2 parents c62f3ae + b847d7b commit 6b094a4

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
@@ -1581,15 +1581,11 @@ information in a controller via the ``Request`` object::
15811581
}
15821582
}
15831583

1584-
You can get this information in services too injecting the ``request_stack``
1585-
service to :doc:`get the Request object in a service </service_container/request>`.
1586-
In templates, use the :ref:`Twig global app variable <twig-app-variable>` to get
1587-
the current route and its attributes:
1588-
1589-
.. code-block:: twig
1590-
1591-
{% set route_name = app.current_route %}
1592-
{% set route_parameters = app.current_route_parameters %}
1584+
In services, you can get this information by
1585+
:doc:`injecting the RequestStack service </service_container/request>`.
1586+
In templates, use the :ref:`Twig global app variable <twig-app-variable>`
1587+
to get the current route name (``app.current_route``) and its parameters
1588+
(``app.current_route_parameters``).
15931589

15941590
Special Routes
15951591
--------------

0 commit comments

Comments
 (0)