GlobalVariables
class GlobalVariables
GlobalVariables is the entry point for Symfony global variables in PHP templates.
Methods
__construct(ContainerInterface $container) | ||
SecurityContext|null | getSecurity() deprecated Returns the security context service. | |
mixed | getUser() Returns the current user. | |
Request|null | getRequest() Returns the current request. | |
Session|null | getSession() Returns the current session. | |
string | getEnvironment() Returns the current app environment. | |
bool | getDebug() Returns the current app debug mode. |
Details
__construct(ContainerInterface $container)
Parameters
ContainerInterface | $container |
SecurityContext|null getSecurity() deprecated
deprecated
Returns the security context service.
Return Value
SecurityContext|null | The security context |
mixed getUser()
Returns the current user.
Return Value
mixed |
See also
TokenInterface::getUser() |
Request|null getRequest()
Returns the current request.
Return Value
Request|null | The HTTP request object |
Session|null getSession()
Returns the current session.
Return Value
Session|null | The session |
string getEnvironment()
Returns the current app environment.
Return Value
string | The current environment string (e.g 'dev') |
bool getDebug()
Returns the current app debug mode.
Return Value
bool | The current debug mode |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.html