8000 minor #6535 Improved the description of the Twig global variables (ja… · symfony/symfony-docs@b4d1839 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4d1839

Browse files
committed
minor #6535 Improved the description of the Twig global variables (javiereguiluz)
This PR was squashed before being merged into the 2.3 branch (closes #6535). Discussion ---------- Improved the description of the Twig global variables I was reading this section and I realized that these variables weren't explained but just described with "useless" descriptions. I propose to explain them more deeply. Commits ------- 1873b67 Improved the description of the Twig global variables
2 parents 237bc1c + 1873b67 commit b4d1839

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

book/templating.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,15 +1202,22 @@ instance which will give you access to some application specific variables
12021202
automatically:
12031203

12041204
``app.security``
1205-
The security context.
1205+
The :class:`Symfony\\Component\\Security\\Core\\SecurityContext` object or
1206+
``null`` if there is none.
12061207
``app.user``
1207-
The current user object.
1208+
The representation of the current user or ``null`` if there is none. The
1209+
value stored in this variable can be a :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface`
1210+
object, any other object which implements a ``__toString()`` method or even
1211+
a regular string.
12081212
``app.request``
1209-
The request object.
1213+
The :class:`Symfony\\Component\\HttpFoundation\\Request` object that represents
1214+
the current request (depending on your application, this can be a sub-request
1215+
or a regular request, as explained later).
12101216
``app.session``
1211-
The session object.
1217+
The :class:`Symfony\\Component\\HttpFoundation\\Session\\Session` object that
1218+
represents the current user's session or ``null`` if there is none.
12121219
``app.environment``
1213-
The current environment (dev, prod, etc).
1220+
The name of the current environment (``dev``, ``prod``, etc).
12141221
``app.debug``
12151222
True if in debug mode. False otherwise.
12161223

0 commit comments

Comments
 (0)
0