Action
Less than 1 minute
Action
Abstract controller action class.
This controller handles actions and responses using views
Properties
view
public View $viewname
protected string $name = 'action'methods
protected array $methodsMethods
__construct
public __construct(Request $request): voidParameters
| Parameter | Type | Description |
|---|---|---|
$request | Request |
layout
Sets the layout view for the controller.
public layout(string $view, array $data): voidInitializes a new Layout instance with the specified view and optional data, and assigns it to the controller's view property.
Parameters
| Parameter | Type | Description |
|---|---|---|
$view | string | the name of the layout view to use |
$data | array | optional associative array of data to pass to the layout view |
view
Sets the view for the current controller action.
public view(string $view, array $data): voidInstantiates a new View object with the specified view name and optional data array.
Parameters
| Parameter | Type | Description |
|---|---|---|
$view | string | the name of the view to render |
$data | array | Optional associative array of data to pass to the view. Defaults to an empty array. |
sendEarlyHints
public sendEarlyHints(array $links): boolParameters
| Parameter | Type | Description |
|---|---|---|
$links | array |
registerMethod
Registers a new method with the given name and callback.
public registerMethod(string $name, callable $callback): boolParameters
| Parameter | Type | Description |
|---|---|---|
$name | string | the name of the method to register |
$callback | callable | the callback function to associate with the method |
runAction
public runAction(string $actionName, array $actionArgs, bool $namedActionArgs): ResponseParameters
| Parameter | Type | Description |
|---|---|---|
$actionName | string | |
$actionArgs | array | |
$namedActionArgs | bool |
Generated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000