class Route implements Router

Bidirectional route mapping between HTTP requests and parameter arrays using a URL mask.

Constants

Value

key used in metadata

Pattern

key used in metadata

FilterIn

key used in metadata

FilterOut

key used in metadata

FilterTable

key used in metadata

FilterStrict

key used in metadata

VALUE

PATTERN

FILTER_IN

FILTER_OUT

FILTER_TABLE

FILTER_STRICT

private Default

key used in metadata

private Fixity

key used in metadata

private FilterTableOut

key used in metadata

private Host

url type

private Path

url type

private Relative

url type

private InQuery

fixity types - has default value and is:

private InPath

fixity types - has default value and is:

private Constant

fixity types - has default value and is:

Properties

protected array<string,array<string,mixed>> $defaultMeta

Methods

__construct(string $mask, array $metadata = [])

No description

string
getMask()

No description

array
getMetadata()

No description

array
getDefaults()

No description

array
getConstantParameters()

Returns parameters that must have a specific fixed value for the route to match.

array|null
match(IRequest $httpRequest)

No description

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

No description

static string
param2path(string $s)

Encodes a parameter value for use in a URL path segment, leaving allowed characters unencoded.

Details

at line 101
__construct(string $mask, array $metadata = [])

No description

Parameters

string $mask

e.g. '//<id \d{1,3}>'

array $metadata

default values or metadata

at line 109
string getMask()

No description

Return Value

string

at line 119
protected array getMetadata()

internal  
 

No description

Return Value

array

at line 126
array getDefaults()

No description

Return Value

array

at line 144
array getConstantParameters()

internal  
 

Returns parameters that must have a specific fixed value for the route to match.

Return Value

array

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

No description

Parameters

IRequest $httpRequest

Return Value

array|null

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

No description

Parameters

array $params
UrlScript $refUrl

Return Value

string|null

at line 650
static string param2path(string $s)

Encodes a parameter value for use in a URL path segment, leaving allowed characters unencoded.

Parameters

string $s

Return Value

string