Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ gives you access to these variables:
``app.token``
A :class:`Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface`
object representing the security token.
``app.current_route``
The name of the route associated to the current request or ``null`` if no
request is available (equivalent to ``app.request.attributes.get('_route')``)
``app.current_route_parameters``
An array with the parameters passed to the route of the current request or an
empty array if no request is available (equivalent to ``app.request.attributes.get('_route_params')``)

.. versionadded:: 6.2

The ``app.current_route`` and ``app.current_route_parameters`` variables
were introduced in Symfony 6.2.

In addition to the global ``app`` variable injected by Symfony, you can also
:doc:`inject variables automatically to all Twig templates </templating/global_variables>`.
Expand Down