Action
Less than 1 minute
Action
Properties
view
public ViewRenderer $view
methods
protected array $methods
Methods
__construct
public __construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$name | string |
initialize
Initializes the controller action with the given request.
public initialize({Array})
This method checks if the request is an instance of HTTP, is not an XMLHttpRequest, the application is not null, the response type is 'html', and the application configuration has a 'layout' setting. If all these conditions are met, it sets the view layout to the specified layout in the application configuration.
Parameters
Parameter | Type | Description |
---|---|---|
$request | Request | the request object to initialize the action with |
registerMethod
Registers a new method with the given name and callback.
public registerMethod({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$name | string | the name of the method to register |
$callback | callable | the callback function to associate with the method |
runAction
Executes the specified action and returns the response.
public runAction({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$actionName | string | the name of the action to execute |
$actionArgs | array | the arguments to pass to the action |
$namedActionArgs | bool | whether the action arguments are named |
view
Loads a view.
protected view({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$view | string | the name of the view to load |
layout
Sets the layout view for the current controller.
protected layout({Array})
This method sets the layout view that will be used to render the response.
Parameters
Parameter | Type | Description |
---|---|---|
$view | string | the name of the layout view to be used |
Generated by Hazaar API Doc Generator