Skip to content

Psr7Router

  • Full name: \Qubus\Routing\Psr7Router

Methods

match

Match a given Request Url against stored routes converted into a Response.

public match(\Psr\Http\Message\ServerRequestInterface $serverRequest): \Psr\Http\Message\ResponseInterface

Parameters:

Parameter Type Description
$serverRequest \Psr\Http\Message\ServerRequestInterface

has

Check if a route exists based on its name.

public has(string $name): bool

Parameters:

Parameter Type Description
$name string The name of the route.

Return Value:

True if the named routed exists, false otherwise.


url

Generate url's from named routes.

public url(string $name, array $params = []): string

Parameters:

Parameter Type Description
$name string Name of the route.
$params array Data parameters.

Return Value:

The url.

Throws:


redirect

Redirect one route to another.

public redirect(string $from, string $to, int $status = 302): \Qubus\Routing\Interfaces\Routable

Parameters:

Parameter Type Description
$from string Originating route.
$to string Destination route.
$status int HTTP status code.

Throws:



Automatically generated on 2025-10-13