RouteActions class abstract

Framework\Routing\RouteActions

Class RouteActions.

Defined in libraries/routing/src/RouteActions.php

Methods #

__call()
-
afterAction()
Runs just after the class action method and before the destructor.
beforeAction()
Runs just before the class action method and after the constructor.

__call()

public function __call(string $method, array $arguments): mixed
Parameters
  • string $method
  • array $arguments
Returns mixed

afterAction()

protected function afterAction(string $method, array $arguments, bool $ran, mixed $result): mixed

Runs just after the class action method and before the destructor.

Used to finalize settings, filter output data, acts as a middleware between
the action method and the final response.

Parameters
  • string $method - The action method name
  • array $arguments - The action method arguments
  • bool $ran - Indicates if the class action method was executed, true if it was not intercepted by the beforeAction method
  • mixed $result - The returned value directly from beforeAction or from the class action method, if it was executed
Returns mixed

beforeAction()

protected function beforeAction(string $method, array $arguments): mixed

Runs just before the class action method and after the constructor.

Used to prepare settings, filter input data, acts as a middleware between
the routing and the class action method.

Parameters
  • string $method - The action method name
  • array $arguments - The action method arguments
Returns mixed - Returns a response (any value, except null) to prevent the route action execution or null to continue the process and call the action method