class Application extends ApplicationTrait

Methods

addSuccess($message, $namespace = 'front')

Application Shortcut Methods

addError($message, $namespace = 'front')

No description

addDanger($message, $namespace = 'front')

No description

addWarning($message, $namespace = 'front')

No description

addInfo($message, $namespace = 'front')

No description

addRequestError($message, $namespace = 'front')

No description

clearMessage()

No description

deleteMessage()

No description

setLoginTargetPath($targetPath)

No description

FormBuilder
form(mixed $data = null, array $options = array())

Creates and returns a form builder instance

bool
log(string $message, array $context = array(), int $level = Logger::INFO)

Adds a log record.

mixed
user()

Gets a user from the Security context.

string
encodePassword(UserInterface $user, string $password)

Encodes the raw password.

bool
isGranted(mixed $attributes, mixed $object = null)

Checks if the attributes are granted against the current authentication token and optionally supplied object.

int
mail(Swift_Message $message, array $failedRecipients = null)

Sends an email.

string
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)

Translates the given message.

string
transChoice(string $id, int $number, array $parameters = array(), string $domain = 'messages', string $locale = null)

Translates the given choice message by choosing a translation according to a number.

Response
render(string $view, array $parameters = array(), Response $response = null)

Renders a view and returns a Response.

Response
renderView(string $view, array $parameters = array())

Renders a view.

string
path(string $route, mixed $parameters = array())

Generates a path from the given parameters.

string
url(string $route, mixed $parameters = array())

Generates an absolute URL from the given parameters.

__construct(array $values = array())

No description

initConfig()

No description

initLogger()

No description

initialize()

No description

initLocale()

No description

initSession()

No description

initRendering()

No description

initMailer()

No description

initDoctrine()

No description

initSecurity()

No description

initializePlugin()

No description

initPluginEventDispatcher()

No description

loadPlugin()

No description

Details

in ApplicationTrait at line 20
addSuccess($message, $namespace = 'front')

Application Shortcut Methods

Parameters

$message
$namespace

in ApplicationTrait at line 25
addError($message, $namespace = 'front')

Parameters

$message
$namespace

in ApplicationTrait at line 30
addDanger($message, $namespace = 'front')

Parameters

$message
$namespace

in ApplicationTrait at line 35
addWarning($message, $namespace = 'front')

Parameters

$message
$namespace

in ApplicationTrait at line 40
addInfo($message, $namespace = 'front')

Parameters

$message
$namespace

in ApplicationTrait at line 45
addRequestError($message, $namespace = 'front')

Parameters

$message
$namespace

in ApplicationTrait at line 50
clearMessage()

in ApplicationTrait at line 55
deleteMessage()

in ApplicationTrait at line 61
setLoginTargetPath($targetPath)

Parameters

$targetPath

in ApplicationTrait at line 86
FormBuilder form(mixed $data = null, array $options = array())

Creates and returns a form builder instance

Parameters

mixed $data The initial data for the form
array $options Options for the form

Return Value

FormBuilder

in ApplicationTrait at line 101
bool log(string $message, array $context = array(), int $level = Logger::INFO)

Adds a log record.

Parameters

string $message The log message
array $context The log context
int $level The logging level

Return Value

bool Whether the record has been processed

in ApplicationTrait at line 115
mixed user()

Gets a user from the Security context.

Return Value

mixed

See also

TokenInterface::getUser()

in ApplicationTrait at line 130
string encodePassword(UserInterface $user, string $password)

Encodes the raw password.

Parameters

UserInterface $user A UserInterface instance
string $password The password to encode

Return Value

string The encoded password

Exceptions

RuntimeException when no password encoder could be found for the user

in ApplicationTrait at line 145
bool isGranted(mixed $attributes, mixed $object = null)

Checks if the attributes are granted against the current authentication token and optionally supplied object.

Parameters

mixed $attributes
mixed $object

Return Value

bool

Exceptions

AuthenticationCredentialsNotFoundException when the token storage has no authentication token.

in ApplicationTrait at line 159
int mail(Swift_Message $message, array $failedRecipients = null)

Sends an email.

Parameters

Swift_Message $message A \Swift_Message instance
array $failedRecipients An array of failures by-reference

Return Value

int The number of sent messages

in ApplicationTrait at line 175
string trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)

Translates the given message.

Parameters

string $id The message id
array $parameters An array of parameters for the message
string $domain The domain for the message
string $locale The locale

Return Value

string The translated string

in ApplicationTrait at line 191
string transChoice(string $id, int $number, array $parameters = array(), string $domain = 'messages', string $locale = null)

Translates the given choice message by choosing a translation according to a number.

Parameters

string $id The message id
int $number The number to use to find the indice of the message
array $parameters An array of parameters for the message
string $domain The domain for the message
string $locale The locale

Return Value

string The translated string

in ApplicationTrait at line 208
Response render(string $view, array $parameters = array(), Response $response = null)

Renders a view and returns a Response.

To stream a view, pass an instance of StreamedResponse as a third argument.

Parameters

string $view The view name
array $parameters An array of parameters to pass to the view
Response $response A Response instance

Return Value

Response A Response instance

in ApplicationTrait at line 234
Response renderView(string $view, array $parameters = array())

Renders a view.

Parameters

string $view The view name
array $parameters An array of parameters to pass to the view

Return Value

Response A Response instance

in ApplicationTrait at line 248
string path(string $route, mixed $parameters = array())

Generates a path from the given parameters.

Parameters

string $route The name of the route
mixed $parameters An array of parameters

Return Value

string The generated path

in ApplicationTrait at line 261
string url(string $route, mixed $parameters = array())

Generates an absolute URL from the given parameters.

Parameters

string $route The name of the route
mixed $parameters An array of parameters

Return Value

string The generated URL

at line 42
__construct(array $values = array())

Parameters

array $values

at line 53
initConfig()

at line 136
initLogger()

at line 143
initialize()

at line 203
initLocale()

at line 237
initSession()

at line 263
initRendering()

at line 360
initMailer()

at line 390
initDoctrine()

at line 441
initSecurity()

at line 523
initializePlugin()

at line 532
initPluginEventDispatcher()

at line 570
loadPlugin()