Skip to content

Commit 1873b67

Browse files
javiereguiluzxabbuh
authored andcommitted
Improved the description of the Twig global variables
1 parent 1e1ab96 commit 1873b67

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)