class Route implements Router

The bidirectional route is responsible for mapping HTTP request to an array for dispatch and vice-versa.

Traits

Strict class for better experience.

Constants

VALUE

key used in metadata {@link Route::__construct}

PATTERN

key used in metadata {@link Route::__construct}

FILTER_IN

key used in metadata {@link Route::__construct}

FILTER_OUT

key used in metadata {@link Route::__construct}

FILTER_TABLE

key used in metadata {@link Route::__construct}

FILTER_STRICT

key used in metadata {@link Route::__construct}

DEFAULT

key used in metadata

FIXITY

key used in metadata

FILTER_TABLE_OUT

key used in metadata

HOST

url type

PATH

url type

RELATIVE

url type

OPTIONAL

fixity types - how to handle default value? {@link Route::$metadata}

PATH_OPTIONAL

fixity types - how to handle default value? {@link Route::$metadata}

CONSTANT

fixity types - how to handle default value? {@link Route::$metadata}

Properties

protected array $defaultMeta

Methods

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

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.

string
getMask()

Returns mask.

array
getDefaults()

Returns default values.

array
getMetadata()

No description

array
getConstantParameters()

No description

static string
param2path(string $s)

Url encode.

Details

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

Parameters

string $mask
array $metadata

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

Maps HTTP request to an array.

Parameters

IRequest $httpRequest

Return Value

array|null

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

Constructs absolute URL from array.

Parameters

array $params
UrlScript $refUrl

Return Value

string|null

at line 502
string getMask()

Returns mask.

Return Value

string

at line 511
array getDefaults()

Returns default values.

Return Value

array

at line 524
protected array getMetadata()

Return Value

array

at line 531
array getConstantParameters()

Return Value

array

at line 572
static string param2path(string $s)

Url encode.

Parameters

string $s

Return Value

string