PHP Class Eccube\Application\ApplicationTrait

Inheritance: extends Silex\Application
Afficher le fichier Open project: ec-cube/ec-cube Class Usage Examples

Méthodes publiques

Méthode Description
addDanger ( $message, $namespace = 'front' )
addError ( $message, $namespace = 'front' )
addInfo ( $message, $namespace = 'front' )
addRequestError ( $message, $namespace = 'front' )
addSuccess ( $message, $namespace = 'front' ) Application Shortcut Methods
addWarning ( $message, $namespace = 'front' )
clearMessage ( )
deleteMessage ( )
encodePassword ( Symfony\Component\Security\Core\User\UserInterface $user, string $password ) : string Encodes the raw password.
form ( mixed $data = null, array $options = [] ) : FormBuilder Creates and returns a form builder instance
isAdminRequest ( )
isFrontRequest ( )
isGranted ( mixed $attributes, mixed $object = null ) : boolean Checks if the attributes are granted against the current authentication token and optionally supplied object.
log ( string $message, array $context = [], integer $level = Logger::INFO ) : boolean Adds a log record.
mail ( Swift_Message $message, array &$failedRecipients = null ) : integer Sends an email.
path ( string $route, mixed $parameters = [] ) : string Generates a path from the given parameters.
render ( string $view, array $parameters = [], Response $response = null ) : Response Renders a view and returns a Response.
renderView ( string $view, array $parameters = [] ) : string Renders a view.
setLoginTargetPath ( $targetPath, $namespace = null )
trans ( string $id, array $parameters = [], string $domain = 'messages', string $locale = null ) : string Translates the given message.
transChoice ( string $id, integer $number, array $parameters = [], string $domain = 'messages', string $locale = null ) : string Translates the given choice message by choosing a translation according to a number.
url ( string $route, mixed $parameters = [] ) : string Generates an absolute URL from the given parameters.
user ( ) : mixed Gets a user from the Security context.

Method Details

addDanger() public méthode

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

addError() public méthode

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

addInfo() public méthode

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

addRequestError() public méthode

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

addSuccess() public méthode

Application Shortcut Methods
public addSuccess ( $message, $namespace = 'front' )

addWarning() public méthode

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

clearMessage() public méthode

public clearMessage ( )

deleteMessage() public méthode

public deleteMessage ( )

encodePassword() public méthode

Encodes the raw password.
public encodePassword ( Symfony\Component\Security\Core\User\UserInterface $user, string $password ) : string
$user Symfony\Component\Security\Core\User\UserInterface A UserInterface instance
$password string The password to encode
Résultat string The encoded password

form() public méthode

Creates and returns a form builder instance
public form ( mixed $data = null, array $options = [] ) : FormBuilder
$data mixed The initial data for the form
$options array Options for the form
Résultat Symfony\Component\Form\FormBuilder

isAdminRequest() public méthode

public isAdminRequest ( )

isFrontRequest() public méthode

public isFrontRequest ( )

isGranted() public méthode

Checks if the attributes are granted against the current authentication token and optionally supplied object.
public isGranted ( mixed $attributes, mixed $object = null ) : boolean
$attributes mixed
$object mixed
Résultat boolean

log() public méthode

Adds a log record.
public log ( string $message, array $context = [], integer $level = Logger::INFO ) : boolean
$message string The log message
$context array The log context
$level integer The logging level
Résultat boolean Whether the record has been processed

mail() public méthode

Sends an email.
public mail ( Swift_Message $message, array &$failedRecipients = null ) : integer
$message Swift_Message A \Swift_Message instance
$failedRecipients array An array of failures by-reference
Résultat integer The number of sent messages

path() public méthode

Generates a path from the given parameters.
public path ( string $route, mixed $parameters = [] ) : string
$route string The name of the route
$parameters mixed An array of parameters
Résultat string The generated path

render() public méthode

To stream a view, pass an instance of StreamedResponse as a third argument.
public render ( string $view, array $parameters = [], Response $response = null ) : Response
$view string The view name
$parameters array An array of parameters to pass to the view
$response Symfony\Component\HttpFoundation\Response A Response instance
Résultat Symfony\Component\HttpFoundation\Response A Response instance

renderView() public méthode

Renders a view.
public renderView ( string $view, array $parameters = [] ) : string
$view string The view name
$parameters array An array of parameters to pass to the view
Résultat string The rendered view

setLoginTargetPath() public méthode

public setLoginTargetPath ( $targetPath, $namespace = null )

trans() public méthode

Translates the given message.
public trans ( string $id, array $parameters = [], string $domain = 'messages', string $locale = null ) : string
$id string The message id
$parameters array An array of parameters for the message
$domain string The domain for the message
$locale string The locale
Résultat string The translated string

transChoice() public méthode

Translates the given choice message by choosing a translation according to a number.
public transChoice ( string $id, integer $number, array $parameters = [], string $domain = 'messages', string $locale = null ) : string
$id string The message id
$number integer The number to use to find the indice of the message
$parameters array An array of parameters for the message
$domain string The domain for the message
$locale string The locale
Résultat string The translated string

url() public méthode

Generates an absolute URL from the given parameters.
public url ( string $route, mixed $parameters = [] ) : string
$route string The name of the route
$parameters mixed An array of parameters
Résultat string The generated URL

user() public méthode

Gets a user from the Security context.
See also: TokenInterface::getUser()
public user ( ) : mixed
Résultat mixed