Properties

$routeString

$routeString : string

Route string

Type

string

$segments

$segments : array

Segments of route string

Type

array

$route

$route : string

Matched route

Type

string

$defaultRoute

$defaultRoute : array

Default route

Type

array

$dynamicRoute

$dynamicRoute : string

Dynamic route

Type

string

$dynamicRoutePrefix

$dynamicRoutePrefix : array

Dynamic route prefix

Type

array

$isDynamicRoute

$isDynamicRoute : boolean

Flag for dynamic route

Type

boolean

$routes

$routes : array

Routes

Type

array

$preparedRoutes

$preparedRoutes : array

Prepared routes

Type

array

$controllerParams

$controllerParams : array

Controller parameters

Type

array

$routeParams

$routeParams : array

Route parameters

Type

array

$routeNames

$routeNames : array

Route names

Type

array

$basePath

$basePath : string

Base path

Type

string

Methods

addRoute()

addRoute(string  $route, mixed  $controller) : \Pop\Router\Match\AbstractMatch

Add a route

Parameters

string $route
mixed $controller

Returns

\Pop\Router\Match\AbstractMatch

addRoutes()

addRoutes(array  $routes) : \Pop\Router\Match\AbstractMatch

Add multiple controller routes

Parameters

array $routes

Returns

\Pop\Router\Match\AbstractMatch

name()

name(string  $routeName) : \Pop\Router\Match\AbstractMatch

Add a route name

Parameters

string $routeName

Throws

\Pop\Router\Match\Exception

Returns

\Pop\Router\Match\AbstractMatch

hasName()

hasName(string  $routeName) : boolean

Has a route name

Parameters

string $routeName

Returns

boolean

addControllerParams()

addControllerParams(string  $controller, mixed  $params) : \Pop\Router\Match\AbstractMatch

Add controller params to be passed into a new controller instance

Parameters

string $controller
mixed $params

Returns

\Pop\Router\Match\AbstractMatch

appendControllerParams()

appendControllerParams(string  $controller, mixed  $params) : \Pop\Router\Match\AbstractMatch

Append controller params to be passed into a new controller instance

Parameters

string $controller
mixed $params

Returns

\Pop\Router\Match\AbstractMatch

getControllerParams()

getControllerParams(string  $controller) : mixed

Get the params assigned to the controller

Parameters

string $controller

Returns

mixed

hasControllerParams()

hasControllerParams(string  $controller) : boolean

Determine if the controller has params

Parameters

string $controller

Returns

boolean

removeControllerParams()

removeControllerParams(string  $controller) : \Pop\Router\Match\AbstractMatch

Remove controller params

Parameters

string $controller

Returns

\Pop\Router\Match\AbstractMatch

getRouteString()

getRouteString() : string

Get the route string

Returns

string

getSegments()

getSegments() : array

Get the route string segments

Returns

array

getSegment()

getSegment(integer  $i) : string

Get a route string segment

Parameters

integer $i

Returns

string

getOriginalRoute()

getOriginalRoute() : string

Get original route string

Returns

string

getRoute()

getRoute() : string

Get route regex

Returns

string

getRoutes()

getRoutes() : array

Get routes

Returns

array

getPreparedRoutes()

getPreparedRoutes() : array

Get prepared routes

Returns

array

hasRouteConfig()

hasRouteConfig(string  $key = null) : boolean

Has route config

Parameters

string $key

Returns

boolean

getRouteConfig()

getRouteConfig(string  $key = null) : mixed

Get route config

Parameters

string $key

Returns

mixed

getFlattenedRoutes()

getFlattenedRoutes() : array

Get flattened routes

Returns

array

getRouteParams()

getRouteParams() : array

Get the params discovered from the route

Returns

array

hasRouteParams()

hasRouteParams() : boolean

Determine if the route has params

Returns

boolean

getDefaultRoute()

getDefaultRoute() : array

Get the default route

Returns

array

hasDefaultRoute()

hasDefaultRoute() : boolean

Determine if there is a default route

Returns

boolean

getDynamicRoute()

getDynamicRoute() : string

Get the dynamic route

Returns

string

getDynamicRoutePrefix()

getDynamicRoutePrefix() : array

Get the dynamic route prefix

Returns

array

hasDynamicRoute()

hasDynamicRoute() : boolean

Determine if there is a dynamic route

Returns

boolean

isDynamicRoute()

isDynamicRoute() : boolean

Determine if it is a dynamic route

Returns

boolean

getController()

getController() : mixed

Get the controller

Returns

mixed

hasController()

hasController() : boolean

Determine if there is a controller

Returns

boolean

getAction()

getAction() : mixed

Get the action

Returns

mixed

hasAction()

hasAction() : boolean

Determine if there is an action

Returns

boolean

hasRoute()

hasRoute() : boolean

Determine if the route has been matched

Returns

boolean

match()

match(string  $forceRoute = null) : boolean

Match the route

Parameters

string $forceRoute

Returns

boolean

noRouteFound()

noRouteFound(boolean  $exit = true) : void

Method to process if a route was not found

Parameters

boolean $exit

__construct()

__construct() 

Constructor

Instantiate the HTTP match object

getBasePath()

getBasePath() : string

Get the base path

Returns

string

getUrl()

getUrl(string  $routeName, mixed  $params = null, boolean  $fqdn = false) : string

Get URL for the named route

Parameters

string $routeName
mixed $params
boolean $fqdn

Returns

string

flattenRoutes()

flattenRoutes(array|string  $route, mixed  $controller = null) : void

Flatten the nested routes

Parameters

array|string $route
mixed $controller

getRouteRegex()

getRouteRegex(string  $route) : array

Get the REGEX pattern for the route string

Parameters

string $route

Returns

array

parseRouteParams()

parseRouteParams() : void

Parse route dispatch parameters