AppVariable
in package
Exposes some Symfony parameters and services as an "app" global variable.
Tags
Table of Contents
Properties
- $debug : bool
- $environment : string
- $requestStack : mixed
- $tokenStorage : mixed
Methods
- 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() : UserInterface|null
- Returns the current user.
- setDebug() : mixed
- setEnvironment() : mixed
- setRequestStack() : mixed
- setTokenStorage() : mixed
Properties
$debug
private
bool
$debug
$environment
private
string
$environment
$requestStack
private
mixed
$requestStack
$tokenStorage
private
mixed
$tokenStorage
Methods
getDebug()
Returns the current app debug mode.
public
getDebug() : bool
Return values
boolgetEnvironment()
Returns the current app environment.
public
getEnvironment() : string
Return values
stringgetFlashes()
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([string|array<string|int, mixed> $types = null ]) : array<string|int, mixed>
Parameters
- $types : string|array<string|int, mixed> = null
Return values
array<string|int, mixed>getRequest()
Returns the current request.
public
getRequest() : Request|null
Return values
Request|nullgetSession()
Returns the current session.
public
getSession() : Session|null
Return values
Session|nullgetToken()
Returns the current token.
public
getToken() : TokenInterface|null
Tags
Return values
TokenInterface|nullgetUser()
Returns the current user.
public
getUser() : UserInterface|null
Tags
Return values
UserInterface|nullsetDebug()
public
setDebug(bool $debug) : mixed
Parameters
- $debug : bool
setEnvironment()
public
setEnvironment(string $environment) : mixed
Parameters
- $environment : string
setRequestStack()
public
setRequestStack(RequestStack $requestStack) : mixed
Parameters
- $requestStack : RequestStack
setTokenStorage()
public
setTokenStorage(TokenStorageInterface $tokenStorage) : mixed
Parameters
- $tokenStorage : TokenStorageInterface