From c932b044450c82eb535822e3c1cf9154e77d7623 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 5 May 2016 17:47:15 +0200 Subject: [PATCH 1/2] Improved the description of the Twig global variables --- book/templating.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 4d99b4dc9bc..ad936092b95 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1202,15 +1202,22 @@ instance which will give you access to some application specific variables automatically: ``app.security`` - The security context. + The :class:`Symfony\Component\Security\Core\SecurityContext` object or + ``null`` if there is none. ``app.user`` - The current user object. + The representation of the current user or ``null`` if there is none. The + value stored in this variable can be a :class:`Symfony\Component\Security\Core\User\UserInterface` + object, any other object which implements a ``__toString()`` method or even + a regular string. ``app.request`` - The request object. + The :class:`Symfony\Component\HttpFoundation\Request` object that represents + the current request (depending on your application, this can be a sub-request + or a regular request, as explained later). ``app.session`` - The session object. + The :class:`Symfony\Component\HttpFoundation\Session\Session` object that + represents the current user's session or ``null`` if there is none. ``app.environment`` - The current environment (dev, prod, etc). + The name of the current environment (``dev``, ``prod``, etc). ``app.debug`` True if in debug mode. False otherwise. From 315941bab3e2aba2c5be6fd5fc7be52883b99fd0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 6 May 2016 09:01:07 +0200 Subject: [PATCH 2/2] Fixed a syntax issue --- book/templating.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index ad936092b95..41202fe8c92 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1202,19 +1202,19 @@ instance which will give you access to some application specific variables automatically: ``app.security`` - The :class:`Symfony\Component\Security\Core\SecurityContext` object or + The :class:`Symfony\\Component\\Security\\Core\\SecurityContext` object or ``null`` if there is none. ``app.user`` The representation of the current user or ``null`` if there is none. The - value stored in this variable can be a :class:`Symfony\Component\Security\Core\User\UserInterface` + value stored in this variable can be a :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface` object, any other object which implements a ``__toString()`` method or even a regular string. ``app.request`` - The :class:`Symfony\Component\HttpFoundation\Request` object that represents + The :class:`Symfony\\Component\\HttpFoundation\\Request` object that represents the current request (depending on your application, this can be a sub-request or a regular request, as explained later). ``app.session`` - The :class:`Symfony\Component\HttpFoundation\Session\Session` object that + The :class:`Symfony\\Component\\HttpFoundation\\Session\\Session` object that represents the current user's session or ``null`` if there is none. ``app.environment`` The name of the current environment (``dev``, ``prod``, etc).