class RouteList implements Router

The router broker.

Traits

Strict class for better experience.

Properties

protected RouteList|null $parent

Methods

__construct()

No description

array|null
match(IRequest $httpRequest)

Maps HTTP request to an array.

string|null
constructUrl(array $params, UrlScript $refUrl)

Constructs absolute URL from array.

void
warmupCache()

No description

add(Router $router, int $flags = 0)

Adds a router.

void
prepend(Router $router, int $flags = 0)

Prepends a router.

void
modify(int $index, Router|null $router)

No description

addRoute(string $mask, $metadata = [], int $flags = 0)

No description

withDomain(string $domain)

Returns an iterator over all routers.

withPath(string $path)

No description

end()

No description

array
getRouters()

No description

Details

at line 44
__construct()

at line 52
array|null match(IRequest $httpRequest)

Maps HTTP request to an array.

Parameters

IRequest $httpRequest

Return Value

array|null

at line 83
string|null constructUrl(array $params, UrlScript $refUrl)

Constructs absolute URL from array.

Parameters

array $params
UrlScript $refUrl

Return Value

string|null

at line 121
void warmupCache()

Return Value

void

at line 175
RouteList add(Router $router, int $flags = 0)

Adds a router.

Parameters

Router $router
int $flags

Return Value

RouteList

at line 186
void prepend(Router $router, int $flags = 0)

Prepends a router.

Parameters

Router $router
int $flags

Return Value

void

at line 194
protected void modify(int $index, Router|null $router)

Parameters

int $index
Router|null $router

Return Value

void

at line 212
RouteList addRoute(string $mask, $metadata = [], int $flags = 0)

Parameters

string $mask
$metadata
int $flags

Return Value

RouteList

at line 223
RouteList withDomain(string $domain)

Returns an iterator over all routers.

Parameters

string $domain

Return Value

RouteList

at line 237
RouteList withPath(string $path)

Parameters

string $path

Return Value

RouteList

at line 251
RouteList end()

Return Value

RouteList

at line 260
array getRouters()

Return Value

array