PHP Class Eccube\Application\ApplicationTrait

Inheritance: extends Silex\Application
Mostrar archivo Open project: ec-cube/ec-cube Class Usage Examples

Public Methods

Method 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 method

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

addError() public method

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

addInfo() public method

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

addRequestError() public method

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

addSuccess() public method

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

addWarning() public method

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

clearMessage() public method

public clearMessage ( )

deleteMessage() public method

public deleteMessage ( )

encodePassword() public method

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
return string The encoded password

form() public method

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
return Symfony\Component\Form\FormBuilder

isAdminRequest() public method

public isAdminRequest ( )

isFrontRequest() public method

public isFrontRequest ( )

isGranted() public method

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
return boolean

log() public method

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
return boolean Whether the record has been processed

mail() public method

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
return integer The number of sent messages

path() public method

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
return string The generated path

render() public method

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
return Symfony\Component\HttpFoundation\Response A Response instance

renderView() public method

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
return string The rendered view

setLoginTargetPath() public method

public setLoginTargetPath ( $targetPath, $namespace = null )

trans() public method

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
return string The translated string

transChoice() public method

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
return string The translated string

url() public method

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
return string The generated URL

user() public method

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