PHP Class Frontend\Core\Engine\Base\AjaxAction

Inheritance: extends KernelLoader
Show file Open project: forkcms/forkcms Class Usage Examples

Protected Properties

Property Type Description
$action string The current action
$content array
$module string The current module

Public Methods

Method Description
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel, string $action, string $module )
execute ( ) Execute the action
getAction ( ) : string Get the action
getContent ( ) : Response Since the display action in the backend is rather complicated and we want to make this work with our Kernel, I've added this getContent method to extract the output from the actual displaying.
getModule ( ) : string Get the module
output ( integer $statusCode, mixed $data = null, string $message = null ) Outputs an answer to the browser

Protected Methods

Method Description
setAction ( string $action ) Set the action, for later use
setModule ( string $module ) Set the module, for later use

Method Details

__construct() public method

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel, string $action, string $module )
$kernel Symfony\Component\HttpKernel\KernelInterface
$action string The action to use.
$module string The module to use.

execute() public method

Execute the action
public execute ( )

getAction() public method

Get the action
public getAction ( ) : string
return string

getContent() public method

With this function we'll be able to get the content and return it as a Symfony output object.
public getContent ( ) : Response
return Symfony\Component\HttpFoundation\Response

getModule() public method

Get the module
public getModule ( ) : string
return string

output() public method

Outputs an answer to the browser
public output ( integer $statusCode, mixed $data = null, string $message = null )
$statusCode integer The status code to use, use one of the available constants (self::OK, self::BAD_REQUEST, self::FORBIDDEN, self::ERROR).
$data mixed The data to be returned (will be encoded as JSON).
$message string A text-message.

setAction() protected method

Set the action, for later use
protected setAction ( string $action )
$action string The action to use.

setModule() protected method

Set the module, for later use
protected setModule ( string $module )
$module string The module to use.

Property Details

$action protected property

The current action
protected string $action
return string

$content protected property

protected array $content
return array

$module protected property

The current module
protected string $module
return string