Class

Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables

class GlobalVariables

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

Methods

__construct(ContainerInterface $container)

SecurityContext|void getSecurity()

Returns the security context service.

mixed|void getUser()

Returns the current user.

Request|void getRequest()

Returns the current request.

Session|void getSession()

Returns the current session.

string getEnvironment()

Returns the current app environment.

Boolean getDebug()

Returns the current app debug mode.

Details

at line 25
public __construct(ContainerInterface $container)

Parameters

ContainerInterface $container

at line 35
public SecurityContext|void getSecurity()

Returns the security context service.

Return Value

SecurityContext|void The security context

at line 49
public mixed|void getUser()

Returns the current user.

Return Value

mixed|void

See also

Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser()

at line 72
public Request|void getRequest()

Returns the current request.

Return Value

Request|void The http request object

at line 84
public Session|void getSession()

Returns the current session.

Return Value

Session|void The session

at line 96
public string getEnvironment()

Returns the current app environment.

Return Value

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

at line 106
public Boolean getDebug()

Returns the current app debug mode.

Return Value

Boolean The current debug mode