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

$commands

$commands : array

Route commands

Type

array

$options

$options : array

Allowed route options

Type

array

$parameters

$parameters : array

Allowed route parameters

Type

array

$hasAllRequired

$hasAllRequired : boolean

Flag for all required parameters

Type

boolean

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

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

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() : boolean

Match the route

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 CLI match object

getCommands()

getCommands() : array

Get the route commands

Returns

array

getParameters()

getParameters() : array

Get the parsed route params

Returns

array

getParameter()

getParameter(string  $name) : mixed

Get a parsed route param

Parameters

string $name

Returns

mixed

getOptions()

getOptions() : array

Get the parsed route options

Returns

array

getOption()

getOption(string  $name) : mixed

Get a parsed route option

Parameters

string $name

Returns

mixed

flattenRoutes()

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

Flatten the nested routes

Parameters

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