Documentation

Router

Table of Contents

$maxReroutes  : int
$reroutes  : int
$routeDispatcher  : Dispatcher|null
execute()  : mixed
executeControllerAction()  : mixed
executePath()  : mixed
Executes an action for a specified path Maps [<name>, <action>] to <Name>Controller::action_<action> (defaultIndex controller / action_index when missing), overwrites request()->urlParts and dies once more than $maxReroutes calls were made. Returns nothing.
reroute()  : void
Tries to reroute the request using FastRoute first, if the route does not exist, it falls back to the ZubZet framework. It replaces the current request state (path and args) via replaceRequest, executes the new route and then returns to the caller, which keeps running.
getRouteDispatcher()  : Dispatcher

Properties

$maxReroutes

public int $maxReroutes = 10

Number of reroutes the controller can perform before aborting

$reroutes

public int $reroutes = 0

Number of times this request was rerouted

$routeDispatcher

private Dispatcher|null $routeDispatcher = null

Methods

execute()

public execute([array<string|int, mixed>|null $customUrlParts = null ]) : mixed
Parameters
$customUrlParts : array<string|int, mixed>|null = null
Return values
mixed —

executeControllerAction()

public executeControllerAction(mixed $controller, mixed $action[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$controller : mixed
$action : mixed
$params : array<string|int, mixed> = []
$arguments : array<string|int, mixed> = []
Return values
mixed —

executePath()

Executes an action for a specified path Maps [<name>, <action>] to <Name>Controller::action_<action> (defaultIndex controller / action_index when missing), overwrites request()->urlParts and dies once more than $maxReroutes calls were made. Returns nothing.

public executePath(array<string|int, mixed> $parts) : mixed
Parameters
$parts : array<string|int, mixed>

Example: ["auth", "login"]

Return values
mixed —

reroute()

Tries to reroute the request using FastRoute first, if the route does not exist, it falls back to the ZubZet framework. It replaces the current request state (path and args) via replaceRequest, executes the new route and then returns to the caller, which keeps running.

public reroute(array<string|int, mixed> $parts) : void
Parameters
$parts : array<string|int, mixed>

The parts of the new route. Example: ["auth", "login"]

Return values
void —

getRouteDispatcher()

private getRouteDispatcher() : Dispatcher
Return values
Dispatcher —

Search results