class GlobalVariables

GlobalVariables is the entry point for Symfony global variables in PHP templates.

Methods

__construct(ContainerInterface $container)

No description

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

at line line 28
__construct(ContainerInterface $container)

Parameters

ContainerInterface $container

at line line 40
SecurityContext|null getSecurity() deprecated

deprecated since version 2.6, to be removed in 3.0.

Returns the security context service.

Return Value

SecurityContext|null The security context

at line line 56
mixed getUser()

Returns the current user.

Return Value

mixed

See also

TokenInterface::getUser()

at line line 81
Request|null getRequest()

Returns the current request.

Return Value

Request|null The HTTP request object

at line line 93
Session|null getSession()

Returns the current session.

Return Value

Session|null The session

at line line 105
string getEnvironment()

Returns the current app environment.

Return Value

string The current environment string (e.g 'dev')

at line line 115
bool getDebug()

Returns the current app debug mode.

Return Value

bool The current debug mode