Action

Actions process a request and produce data to be displayed in a view.

property-read

The callback function to execute for this action

property-read

Additional parameters passed to the constructor. These parameters will be passed to the action's callable.

Methods

Initialize an action.

__construct(callable $callable) 

Additional parameters passed to the constructor are saved in the args property and passed on to $callable.

Arguments

$callable

callable

A callback function to execute for this action.

Returns an instance of the action class that returns the variables passed to it for execution.

defaultAction() : \HotMelt\Action
static

Response

\HotMelt\Action

A default action.

Extracts variables from and processes a request, and generates data.

perform(\HotMelt\Request $request, \HotMelt\Route $route) : array

Arguments

$request

\HotMelt\Request

The request to process.

$route

\HotMelt\Route

A route that matches the request.

Response

array

The data generated while processing the request.

Makes a second attempt at processing a request after the original attempt has failed.

performForException(\HotMelt\Request $request, \HotMelt\Route $route, \HotMelt\exception $exception) : array

This method is called for the action of the error route registered with \HotMelt\Route::error().

Arguments

$request

\HotMelt\Request

The request to process.

$route

\HotMelt\Route

A route that matches the request.

$exception

\HotMelt\exception

The exception that this action should handle.

Response

array

The data generated while processing the request.

Properties

callable

callable : callable

The callback function to execute for this action

Type(s)

callable

args

args : array

Additional parameters passed to the constructor. These parameters will be passed to the action's callable.

Type(s)

array