HttpRedirectRoutingCallback
HttpRedirectRoutingCallback allows redirection of a matched route to a route or URL.
Matched arguments can be rewritten. You need to configure this callback using parameters in the
Synopsis
Section titled “Synopsis”class HttpRedirectRoutingCallback extends RoutingCallback
| Extends | RoutingCallback |
| Since | 1.0.0 |
| Source | Routing/HttpRedirectRoutingCallback.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
initialize(Context $context, array<mixed, mixed> &$route): void | Initialize the callback instance. |
| [`onMatched(array<string, mixed> &$parameters, mixed $legacyContainer = null): bool | WebResponse`](#onmatched) |
initialize()
Section titled “initialize()”public function initialize(Context $context, array<mixed, mixed> &$route): void
Initialize the callback instance.
An array with information about the route.
| Parameter | Type | Description |
|---|---|---|
$context | Context | An Context instance. |
$route | array``<``mixed``, ``mixed``> | An array with information about the route. |
onMatched()
Section titled “onMatched()”public function onMatched(array<string, mixed> &$parameters, mixed $legacyContainer = null): bool|WebResponse
Container-less match hook.
Unused; retained for signature compatibility.
| Parameter | Type | Description |
|---|---|---|
$parameters | array``<``string``, ``mixed``> | Matched parameters (modifiable for rewrite). |
$legacyContainer | mixed | Unused; retained for signature compatibility. |
Returns bool``|WebResponse — false to reject the match on misconfiguration, otherwise a WebResponse carrying the redirect to be sent to the client.
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
appendParameter() | ParameterHolder | Append a parameter. |
appendParameterByRef() | ParameterHolder | Append a parameter by reference. |
clearParameters() | ParameterHolder | Clear all parameters associated with this request. |
getContext() | RoutingCallback | Retrieve the current application context. |
getFlatParameterNames() | ParameterHolder | Retrieve an array of flattened parameter names. |
getParameter() | ParameterHolder | Retrieve a parameter. |
getParameterNames() | ParameterHolder | Retrieve an array of parameter names. |
getParameters() | ParameterHolder | Retrieve an array of parameters. |
hasParameter() | ParameterHolder | Indicates whether or not a parameter exists. |
onGenerate() | RoutingCallback | Gets executed when the route of this callback is about to be reverse generated into an URL. |
onNotMatched() | RoutingCallback | Executed when the route did NOT match (container-less). |
removeParameter() | ParameterHolder | Remove a parameter. |
reset() | RoutingCallback | Returns the callback to its uninitialized state. |
setParameter() | ParameterHolder | Set a parameter. |
setParameterByRef() | ParameterHolder | Set a parameter by reference. |
setParameters() | ParameterHolder | Set an array of parameters. |
setParametersByRef() | ParameterHolder | Set an array of parameters by reference. |