AppVariable
in package
Exposes some Symfony parameters and services as an "app" global variable.
Tags
Table of Contents
- $debug : mixed
- $environment : mixed
- $requestStack : mixed
- $tokenStorage : mixed
- getDebug() : bool
- Returns the current app debug mode.
- getEnvironment() : string
- Returns the current app environment.
- getFlashes() : array<string|int, mixed>
- Returns some or all the existing flash messages: * getFlashes() returns all the flash messages * getFlashes('notice') returns a simple array with flash messages of that type * getFlashes(['notice', 'error']) returns a nested array of type => messages.
- getRequest() : Request|null
- Returns the current request.
- getSession() : Session|null
- Returns the current session.
- getToken() : TokenInterface|null
- Returns the current token.
- getUser() : object|null
- Returns the current user.
- setDebug() : mixed
- setEnvironment() : mixed
- setRequestStack() : mixed
- setTokenStorage() : mixed
Properties
$debug
private
mixed
$debug
$environment
private
mixed
$environment
$requestStack
private
mixed
$requestStack
$tokenStorage
private
mixed
$tokenStorage
Methods
getDebug()
Returns the current app debug mode.
public
getDebug() : bool
Return values
bool —The current debug mode
getEnvironment()
Returns the current app environment.
public
getEnvironment() : string
Return values
string —The current environment string (e.g 'dev')
getFlashes()
Returns some or all the existing flash messages: * getFlashes() returns all the flash messages * getFlashes('notice') returns a simple array with flash messages of that type * getFlashes(['notice', 'error']) returns a nested array of type => messages.
public
getFlashes([mixed $types = null ]) : array<string|int, mixed>
Parameters
- $types : mixed = null
Return values
array<string|int, mixed> —getRequest()
Returns the current request.
public
getRequest() : Request|null
Return values
Request|null —The HTTP request object
getSession()
Returns the current session.
public
getSession() : Session|null
Return values
Session|null —The session
getToken()
Returns the current token.
public
getToken() : TokenInterface|null
Tags
Return values
TokenInterface|null —getUser()
Returns the current user.
public
getUser() : object|null
Tags
Return values
object|null —setDebug()
public
setDebug(mixed $debug) : mixed
Parameters
- $debug : mixed
Return values
mixed —setEnvironment()
public
setEnvironment(mixed $environment) : mixed
Parameters
- $environment : mixed
Return values
mixed —setRequestStack()
public
setRequestStack(RequestStack $requestStack) : mixed
Parameters
- $requestStack : RequestStack
Return values
mixed —setTokenStorage()
public
setTokenStorage(TokenStorageInterface $tokenStorage) : mixed
Parameters
- $tokenStorage : TokenStorageInterface