Documentation

AppVariable
in package

Exposes some Symfony parameters and services as an "app" global variable.

Tags
author

Fabien Potencier fabien@symfony.com

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

Methods

getDebug()

Returns the current app debug mode.

public getDebug() : bool
Return values
bool

getEnvironment()

Returns the current app environment.

public getEnvironment() : string
Return values
string

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([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>

setDebug()

public setDebug(bool $debug) : mixed
Parameters
$debug : bool

setEnvironment()

public setEnvironment(string $environment) : mixed
Parameters
$environment : string

        
On this page

Search results