AppVariable
class AppVariable
Exposes some Symfony parameters and services as an "app" global variable.
Methods
| setContainer(ContainerInterface $container) deprecated | ||
| setTokenStorage(TokenStorageInterface $tokenStorage) | ||
| setRequestStack(RequestStack $requestStack) | ||
| setEnvironment($environment) | ||
| setDebug($debug) | ||
| 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
setContainer(ContainerInterface $container) deprecated
deprecated
Parameters
| ContainerInterface | $container |
setTokenStorage(TokenStorageInterface $tokenStorage)
Parameters
| TokenStorageInterface | $tokenStorage |
setRequestStack(RequestStack $requestStack)
Parameters
| RequestStack | $requestStack |
setEnvironment($environment)
Parameters
| $environment |
setDebug($debug)
Parameters
| $debug |
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/Bridge/Twig/AppVariable.html