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
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Properties

Property 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

Property Type Description
$header Backend\Core\Engine\Header The header object
$parameters array The parameters (urldecoded)

Public Methods

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

Protected Methods

Method Description
getBackendModulePath ( ) : string
parse ( ) Parse to template

Method Details

__construct() public method

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 method

Check if the token is ok
public checkToken ( )

createForm() public method

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

display() public method

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 method

Execute the action
public execute ( )

getBackendModulePath() protected method

protected getBackendModulePath ( ) : string
return string

getParameter() public method

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.
return mixed

parse() protected method

Parse to template
protected parse ( )

Property Details

$URL public_oe property

A reference to the URL-instance
public Url,Backend\Core\Engine $URL
return Backend\Core\Engine\Url

$header protected_oe property

The header object
protected Header,Backend\Core\Engine $header
return Backend\Core\Engine\Header

$parameters protected_oe property

The parameters (urldecoded)
protected array $parameters
return array

$tpl public_oe property

A reference to the current template
public TwigTemplate,Backend\Core\Engine $tpl
return Backend\Core\Engine\TwigTemplate