class Router implements RouterInterface

Traits

Methods

setDefaults(array $defaults)

No description

string
getNamespaceName()

No description

string
getHandlerName()

No description

string
getActionName()

No description

array
getParams()

No description

__construct()

No description

array
load(array $routesConfig)

Load routes config.

map(string $pattern, array|string $handler = null, string|string[] $methods = '*')

Add route.

get($pattern, $handler)

No description

post($pattern, $handler)

No description

put($pattern, $handler)

No description

delete($pattern, $handler)

No description

head($pattern, $handler)

No description

trace($pattern, $handler)

No description

options($pattern, $handler)

No description

dispatch(string $uri = null)

No description

Details

at line 95
setDefaults(array $defaults)

Parameters

array $defaults

in RouterTrait at line 37
string getNamespaceName()

Return Value

string

in RouterTrait at line 42
string getHandlerName()

Return Value

string

in RouterTrait at line 47
string getActionName()

Return Value

string

in RouterTrait at line 52
array getParams()

Return Value

array

at line 21
__construct()

at line 32
array load(array $routesConfig)

Load routes config.

Parameters

array $routesConfig

Return Value

array

at line 50
map(string $pattern, array|string $handler = null, string|string[] $methods = '*')

Add route.

Parameters

string $pattern
array|string $handler
string|string[] $methods 'GET' or ['GET', 'POST']

at line 59
get($pattern, $handler)

Parameters

$pattern
$handler

at line 64
post($pattern, $handler)

Parameters

$pattern
$handler

at line 69
put($pattern, $handler)

Parameters

$pattern
$handler

at line 74
delete($pattern, $handler)

Parameters

$pattern
$handler

at line 79
head($pattern, $handler)

Parameters

$pattern
$handler

at line 84
trace($pattern, $handler)

Parameters

$pattern
$handler

at line 89
options($pattern, $handler)

Parameters

$pattern
$handler

at line 117
dispatch(string $uri = null)

Parameters

string $uri

Exceptions

Exception