Orpheus

ControllerRoute extends Route
in package

AbstractYes

Route for Orpheus.

Table of Contents

Constants

PROVIDERS_KEY  = 'providers'
REQUIREMENTS_KEY  = 'require-packages'

Properties

$controller  : AbstractController
The running controller
$controllerClass  : string
The class of called controller associated to this route
$defaultResponse  : string
Default response if controller returns is invalid
$initialized  : bool
Define this class initialized
$name  : string
A route is identified by its name
$options  : array<string|int, mixed>
Non-processed options in route configuration
$path  : string
The path determine how to access this route
$restrictTo  : array<string|int, mixed>
Restrictions to access this route
$routes  : array<string|int, mixed>
Registered routes
$routesRestrictions  : array<string|int, mixed>
Registered route restrictions

Methods

formatUrl()  : string
Format the URL to this route using $values
getController()  : AbstractController
getControllerClass()  : string
Get the controller class
getCurrentRouteName()  : string
Get the current route name
getLink()  : string
Get link of route
getName()  : string
Get the name
getOptions()  : array<string|int, mixed>
Get route options
getPath()  : string
Get the path
getRoutes()  : array<string|int, ControllerRoute>
Get all registered routes These one are commonly stored in the configuration (routes.yaml)
initialize()  : void
Initialize the route class by loading the configuration (once only)
instantiateController()  : AbstractController
Instantiate the controller and return it
isAccessible()  : bool
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
isInitialized()  : bool
Test if the class is initialized
isMatchingRequest()  : mixed
Test if the route matches the given $request
registerAccessRestriction()  : void
Register the access restriction $type This will be used by isAccessible()
registerConfig()  : mixed
Register a route configuration
run()  : OutputResponse
Run the $request by processing the matching controller
__construct()  : mixed
Constructor
loadRoutes()  : void
Load routes from $package or app (if null)
mergeRoutes()  : void
Merge routes array with routes' logic
populateRoutesFromFile()  : void
Populate given array with routes from $file in $package (or app if null)

Constants

Properties

$controllerClass

The class of called controller associated to this route

protected string $controllerClass

The controller class

$defaultResponse

Default response if controller returns is invalid

protected string $defaultResponse

$initialized

Define this class initialized

protected static bool $initialized = false

$name

A route is identified by its name

protected string $name

The name

$options

Non-processed options in route configuration

protected array<string|int, mixed> $options

$path

The path determine how to access this route

protected string $path

The path

$restrictTo

Restrictions to access this route

protected array<string|int, mixed> $restrictTo

$routes

Registered routes

protected static array<string|int, mixed> $routes = []

$routesRestrictions

Registered route restrictions

protected static array<string|int, mixed> $routesRestrictions = []

Methods

formatUrl()

Format the URL to this route using $values

public abstract formatUrl([array<string|int, mixed> $values = [] ][, array<string|int, mixed> $parameters = [] ]) : string
Parameters
$values : array<string|int, mixed> = []
$parameters : array<string|int, mixed> = []
Return values
string

getControllerClass()

Get the controller class

public getControllerClass() : string
Return values
string

getCurrentRouteName()

Get the current route name

public static getCurrentRouteName() : string
Return values
string

Get link of route

public getLink([array<string|int, mixed> $values = [] ]) : string
Parameters
$values : array<string|int, mixed> = []
Tags
see
formatUrl()
Return values
string

getName()

Get the name

public getName() : string
Return values
string

getOptions()

Get route options

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPath()

Get the path

public getPath() : string
Return values
string

initialize()

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

public static initialize() : void

isAccessible()

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

public isAccessible() : bool
Tags
throws
Exception
Return values
bool

isInitialized()

Test if the class is initialized

public static isInitialized() : bool
Return values
bool

isMatchingRequest()

Test if the route matches the given $request

public abstract isMatchingRequest(InputRequest $request[, array<string|int, mixed> &$values = [] ]) : mixed
Parameters
$request : InputRequest
$values : array<string|int, mixed> = []

registerAccessRestriction()

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

public static registerAccessRestriction(string $type, callable $callable) : void
Parameters
$type : string
$callable : callable
Tags
uses
isAccessible()

registerConfig()

Register a route configuration

public static registerConfig(string $name, array<string|int, mixed> $config) : mixed
Parameters
$name : string
$config : array<string|int, mixed>

__construct()

Constructor

protected __construct(string $name, string $path, string $controller, array<string|int, mixed>|null $restrictTo, string $defaultResponse, array<string|int, mixed> $options) : mixed
Parameters
$name : string
$path : string
$controller : string
$restrictTo : array<string|int, mixed>|null
$defaultResponse : string
$options : array<string|int, mixed>

loadRoutes()

Load routes from $package or app (if null)

protected static loadRoutes(array<string|int, mixed> &$routes[, string|null $package = null ]) : void
Parameters
$routes : array<string|int, mixed>
$package : string|null = null

mergeRoutes()

Merge routes array with routes' logic

protected static mergeRoutes(array<string|int, mixed> &$routes, array<string|int, mixed> $added) : void
Parameters
$routes : array<string|int, mixed>
$added : array<string|int, mixed>

populateRoutesFromFile()

Populate given array with routes from $file in $package (or app if null)

protected static populateRoutesFromFile(array<string|int, mixed> &$routes, string $file[, string|null $package = null ][, bool $optional = false ]) : void
Parameters
$routes : array<string|int, mixed>
$file : string
$package : string|null = null
$optional : bool = false

							
On this page

Search results