Properties

$route

$route : string

Matched route

Type

string

$wildcards

$wildcards : array

Wildcard route

Type

array

$controller

$controller : string

Controller class string name or closure function

Type

string

$action

$action : string

Action name for the controller class

Type

string

$controllerParams

$controllerParams : array

Matched controller parameters

Type

array

$dispatchParams

$dispatchParams : array

Matched dispatch parameters

Type

array

$defaultController

$defaultController : mixed

Default controller class string name or closure function

Type

mixed

$routes

$routes : array

Prepared routes

Type

array

$basePath

$basePath : string

Base path

Type

string

$segments

$segments : array

Array of segments

Type

array

$segmentString

$segmentString : array

Segment string

Type

array

Methods

hasRoute()

hasRoute() : boolean

Determine if the route has been matched

Returns

boolean

getRoute()

getRoute() : string

Get the matched route

Returns

string

getRoutes()

getRoutes() : array

Get the prepared routes

Returns

array

getController()

getController() : string

Get the matched controller class name or closure function

Returns

string

getAction()

getAction() : string

Get the matched action name

Returns

string

getControllerParams()

getControllerParams() : array

Get the matched controller params

Returns

array

hasControllerParams()

hasControllerParams() : boolean

Determine if there are matched controller params

Returns

boolean

getDispatchParams()

getDispatchParams() : array

Get the matched dispatch params

Returns

array

hasDispatchParams()

hasDispatchParams() : boolean

Determine if there are matched dispatch params

Returns

boolean

getDefaultController()

getDefaultController() : mixed

Get the default controller class name or closure function

Returns

mixed

__construct()

__construct() : \Pop\Router\Match\Http

Constructor

Instantiate the HTTP match object

Returns

\Pop\Router\Match\Http

match()

match(array  $routes) : boolean

Match the route to the controller class. Possible matches are:

/foo/:bar/:baz - Route with 2 required params /foo/:bar[/:baz] - Route with 1 required param and 1 optional param /foo/:bar/:baz - 1 required param, 1 required param that is a collection (array) /foo/:bar[/:baz] - 1 required param, 1 optional param that is a collection (array)

- OR -

/foo/*   - Turns off strict matching and allows any route that starts with /foo/ to pass

Parameters

array $routes

Returns

boolean

noRouteFound()

noRouteFound() : void

Method to process if a route was not found

getBasePath()

getBasePath() : string

Get the base path

Returns

string

getSegments()

getSegments() : array

Get the route segments

Returns

array

getSegmentString()

getSegmentString() : string

Get the route segment string

Returns

string

prepareRoutes()

prepareRoutes(array  $routes) : void

Prepare the routes

Parameters

array $routes

getDispatchParamsFromRoute()

getDispatchParamsFromRoute(string  $route) : array

Get parameters from the route string

Parameters

string $route

Returns

array

processDispatchParamsFromRoute()

processDispatchParamsFromRoute(array  $params, array  $dispatchParams) : mixed

Process parameters from the route string

Parameters

array $params
array $dispatchParams

Returns

mixed

processMatchedParams()

processMatchedParams(array  $matchedParams, array  $controller) : mixed

Process matched parameters

Parameters

array $matchedParams
array $controller

Returns

mixed

resetSegments()

resetSegments() : void

Reset URL segments based on route