Properties

$name

$name : string

A route is identified by its name

Type

string — The name

$path

$path : string

The path determine how to access this route

Type

string — The path

$controllerClass

$controllerClass : string

The class of called controller associated to this route

Type

string — The controller class

$options

$options : array

Non-processed options in route configuration

Type

array

$restrictTo

$restrictTo : array

Restrictions to access this route

Type

array

$routes

$routes : array

Registered routes

Type

array

$routesRestrictions

$routesRestrictions : array

Registered route restrictions

Type

array

$initialized

$initialized : string

Define this class initialized

Type

string

$resolverClass

$resolverClass : string

Class of the resolver

Type

string

$parameters

$parameters : array<mixed,string>

Available parameters

Type

array<mixed,string>

Methods

isMatchingRequest()

isMatchingRequest(\Orpheus\InputController\CLIController\CLIRequest  $request, array  $values = array(), boolean  $alternative = false) 

Test current route is matching request

Parameters

\Orpheus\InputController\CLIController\CLIRequest $request
array $values
boolean $alternative

True if we are looking for an alternative route, because we did not find any primary one

getRoutes()

getRoutes() : array

Get registered routes

Returns

array

registerConfig()

registerConfig(string  $name, array  $config) 

Register route by $name from config

Parameters

string $name
array $config

Throws

\Exception

initialize()

initialize() 

Initialize the route class by loading the configuration (once only)

isInitialized()

isInitialized() : boolean

Test if the class is initialized

Returns

boolean

getName()

getName() : string

Get the name

Returns

string

getPath()

getPath() : string

Get the path

Returns

string

getControllerClass()

getControllerClass() : string

Get the controller class

Returns

string

getOptions()

getOptions() : array

Get route options

Returns

array

isAccessible()

isAccessible() : boolean

Test if the route is accessible in the current context using restrictTo This method is sensitive to CHECK_MODULE_ACCESS constant, a true value make it always accessible, never use it in production

Returns

boolean

getLink()

getLink() : boolean

Get the link to this route

Returns

boolean

formatURL()

formatURL(array<mixed,string>  $values = array()) : string

Format the current route to get an URL from path

Parameters

array<mixed,string> $values

Throws

\Orpheus\InputController\CLIController\Exception

Returns

string

registerAccessRestriction()

registerAccessRestriction(string  $type, callable  $callable) 

Register the access restriction $type This will be used by isAccessible()

Parameters

string $type
callable $callable

getCurrentRouteName()

getCurrentRouteName() : \Orpheus\Core\srting

Get the current main route name

Throws

\Exception

Returns

\Orpheus\Core\srting

suggestResolver()

suggestResolver(string  $class) 

Suggest resolve $class

Parameters

string $class

setResolver()

setResolver(string  $class) 

Set the resolver class

Parameters

string $class

getRootCommand()

getRootCommand() 

getUsageCommand()

getUsageCommand() 

__toString()

__toString() : string

Get route as string

Returns

string

register()

register(string  $name, string  $path, string  $controller, array  $parameters, array  $options = array()) 

Register route by $name

Parameters

string $name
string $path
string $controller
array $parameters
array $options

getParameters()

getParameters() 

__construct()

__construct(string  $name, string  $path, string  $controller, array<mixed,string>  $parameters, array  $options) 

Constructor

Parameters

string $name
string $path
string $controller
array<mixed,string> $parameters
array $options