Skip to content

Commit

Permalink
minor #6535 Improved the description of the Twig global variables (ja…
Browse files Browse the repository at this point in the history
…viereguiluz)

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
  • Loading branch information
xabbuh committed May 9, 2016
2 parents 237bc1c + 1873b67 commit b4d1839
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit b4d1839

Please sign in to comment.