PHP Class Backend\Core\Engine\Base\Action

Author: Tijs Verkoyen ([email protected])
Author: Frederik Heyninck ([email protected])
Author: Davy Hellemans ([email protected])
Inheritance: extends Object
Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Свойство Type Description
$URL Backend\Core\Engine\Url A reference to the URL-instance
$tpl Backend\Core\Engine\TwigTemplate A reference to the current template

Protected Properties

Свойство Type Description
$header Backend\Core\Engine\Header The header object
$parameters array The parameters (urldecoded)

Méthodes publiques

Méthode Description
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel ) The constructor will set some properties. It populates the parameter array with urldecoded values for easy-use.
checkToken ( ) Check if the token is ok
createForm ( string | Symfony\Component\Form\FormTypeInterface $type, mixed $data = null, array $options = [] ) : Form Creates and returns a Form instance from the type of the form.
display ( string $template = null ) Display, this wil output the template to the browser If no template is specified we build the path form the current module and action
execute ( ) Execute the action
getParameter ( string $key, string $type = 'string', mixed $defaultValue = null ) : mixed Get a parameter for a given key The function will return null if the key is not available By default we will cast the return value into a string, if you want something else specify it by passing the wanted type.

Méthodes protégées

Méthode Description
getBackendModulePath ( ) : string
parse ( ) Parse to template

Method Details

__construct() public méthode

The constructor will set some properties. It populates the parameter array with urldecoded values for easy-use.
public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface

checkToken() public méthode

Check if the token is ok
public checkToken ( )

createForm() public méthode

Creates and returns a Form instance from the type of the form.
public createForm ( string | Symfony\Component\Form\FormTypeInterface $type, mixed $data = null, array $options = [] ) : Form
$type string | Symfony\Component\Form\FormTypeInterface The built type of the form
$data mixed The initial data for the form
$options array Options for the form
Résultat Symfony\Component\Form\Form

display() public méthode

Display, this wil output the template to the browser If no template is specified we build the path form the current module and action
public display ( string $template = null )
$template string The template to use, if not provided it will be based on the action.

execute() public méthode

Execute the action
public execute ( )

getBackendModulePath() protected méthode

protected getBackendModulePath ( ) : string
Résultat string

getParameter() public méthode

Get a parameter for a given key The function will return null if the key is not available By default we will cast the return value into a string, if you want something else specify it by passing the wanted type.
public getParameter ( string $key, string $type = 'string', mixed $defaultValue = null ) : mixed
$key string The name of the parameter.
$type string The return-type, possible values are: bool, boolean, int, integer, float, double, string, array.
$defaultValue mixed The value that should be returned if the key is not available.
Résultat mixed

parse() protected méthode

Parse to template
protected parse ( )

Property Details

$URL public_oe property

A reference to the URL-instance
public Url,Backend\Core\Engine $URL
Résultat Backend\Core\Engine\Url

$header protected_oe property

The header object
protected Header,Backend\Core\Engine $header
Résultat Backend\Core\Engine\Header

$parameters protected_oe property

The parameters (urldecoded)
protected array $parameters
Résultat array

$tpl public_oe property

A reference to the current template
public TwigTemplate,Backend\Core\Engine $tpl
Résultat Backend\Core\Engine\TwigTemplate