Methods

isCaseSensitive()

isCaseSensitive() : boolean

Returns

boolean

setPrefix()

setPrefix(string  $prefix) : static

Parameters

string $prefix

Returns

static

getPrefix()

getPrefix() : string

Returns

string

setAreas()

setAreas(array  $areas = null) : static

Parameters

array $areas

Returns

static

getAreas()

getAreas() : array

Returns

array

add()

add(string  $pattern, string|array  $paths = null, string  $method = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router on any HTTP method

Parameters

string $pattern
string|array $paths
string $method

Returns

\ManaPHP\Http\Router\RouteInterface

addGet()

addGet(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is GET

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPost()

addPost(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is POST

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPut()

addPut(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is PUT

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addPatch()

addPatch(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is PATCH

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addDelete()

addDelete(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is DELETE

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addOptions()

addOptions(string  $pattern = '{all:.*}', string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Add a route to the router that only match if the HTTP method is OPTIONS

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addHead()

addHead(string  $pattern, string|array  $paths = null) : \ManaPHP\Http\Router\RouteInterface

Adds a route to the router that only match if the HTTP method is HEAD

Parameters

string $pattern
string|array $paths

Returns

\ManaPHP\Http\Router\RouteInterface

addRest()

addRest(string  $pattern, string  $controller = null) : \ManaPHP\Http\Router\RouteInterface

Parameters

string $pattern
string $controller

Returns

\ManaPHP\Http\Router\RouteInterface

match()

match(string  $uri = null, string  $method = null) : \ManaPHP\Http\RouterContext|false

Handles routing information received from the rewrite engine

Parameters

string $uri
string $method

Returns

\ManaPHP\Http\RouterContext|false

dispatch()

dispatch(string  $uri = null, string  $method = null) : mixed

Handles routing information received from the rewrite engine

Parameters

string $uri
string $method

Throws

\ManaPHP\Exception\AbortException

Returns

mixed

getRewriteUri()

getRewriteUri() : string

Get rewrite info.

Returns

string

getArea()

getArea() : string

Returns processed area name

Returns

string

setArea()

setArea(string  $area) : static

Parameters

string $area

Returns

static

getController()

getController() : string

Returns processed controller name

Returns

string

setController()

setController(string  $controller) : static

Parameters

string $controller

Returns

static

getAction()

getAction() : string

Returns processed action name

Returns

string

setAction()

setAction(string  $action) : static

Parameters

string $action

Returns

static

getParams()

getParams() : array

Returns processed extra params

Returns

array

setParams()

setParams(array  $params) : static

Parameters

array $params

Returns

static

wasMatched()

wasMatched() : boolean

Check if the router matches any of the defined routes

Returns

boolean

setMatched()

setMatched(boolean  $matched) : static

Parameters

boolean $matched

Returns

static

createUrl()

createUrl(array|string  $args, string|boolean  $scheme = false) : string

Parameters

array|string $args
string|boolean $scheme

Returns

string