\Charcoal\App\RouteScriptRouteConfig

Base "Route" configuration.

Summary

Methods
Properties
Constants
setIdent()
ident()
setRoute()
route()
setGroups()
addGroup()
groups()
setController()
controller()
setMethods()
addMethod()
methods()
setScriptData()
scriptData()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$ident
$route
$methods
$controller
$groups
$scriptData
N/A

Properties

$ident

$ident : string

Route identifier/name

Type

string

$route

$route : string

Route pattern

Type

string

$methods

$methods : array<mixed,string>

HTTP methods supported by this route

Type

array<mixed,string>

$controller

$controller : string

Response controller classname

Should be the class-ident of an action, a script or a template controller.

Type

string

$groups

$groups : array<mixed,string>

Parent route groups

Type

array<mixed,string>

$scriptData

$scriptData : array

Type

array

Methods

setIdent()

setIdent(string  $ident) : \Charcoal\App\Route\RouteConfig

Set route identifier

Parameters

string $ident

Route identifier.

Throws

\InvalidArgumentException

If the identifier is not a string.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

ident()

ident() : string

Get route identifier

Returns

string

setRoute()

setRoute(string  $pattern) : \Charcoal\App\Route\RouteConfig

Set route pattern.

Parameters

string $pattern

Route pattern.

Throws

\InvalidArgumentException

If the pattern argument is not a string.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

route()

route() : string

Get route pattern

Returns

string

setGroups()

setGroups(array<mixed,string>|array<mixed,\Charcoal\App\Route\RouteGroup>  $groups) : \Charcoal\App\Route\RouteConfig

Set parent route groups

Parameters

array<mixed,string>|array<mixed,\Charcoal\App\Route\RouteGroup> $groups

The parent route groups.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

addGroup()

addGroup(string|\Charcoal\App\Route\RouteGroup  $group) : \Charcoal\App\Route\RouteConfig

Add parent route group

Parameters

string|\Charcoal\App\Route\RouteGroup $group

The parent route group.

Throws

\InvalidArgumentException

If the group is invalid.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

groups()

groups() : array

Get parent route groups

Returns

array

setController()

setController(string  $controller) : \Charcoal\App\Route\RouteConfig

Set route view controller classname

Parameters

string $controller

Route controller name.

Throws

\InvalidArgumentException

If the route view controller is not a string.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

controller()

controller() : string

Get the view controller classname

If not set, the self::ident() will be used by default.

Returns

string

setMethods()

setMethods(array<mixed,string>  $methods) : \Charcoal\App\Route\RouteConfig

Set route methods

Parameters

array<mixed,string> $methods

The route's supported HTTP methods.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

addMethod()

addMethod(string  $method) : \Charcoal\App\Route\RouteConfig

Add route HTTP method.

Parameters

string $method

The route's supported HTTP method.

Throws

\InvalidArgumentException

If the HTTP method is invalid.

Returns

\Charcoal\App\Route\RouteConfig

Chainable

methods()

methods() : array<mixed,string>

Get route methods

Returns

array<mixed,string>

setScriptData()

setScriptData(array  $scriptData) : \Charcoal\App\Route\ActionRouteConfig

Set the action data.

Parameters

array $scriptData

The route data.

Returns

\Charcoal\App\Route\ActionRouteConfig

Chainable

scriptData()

scriptData() : array

Get the action data.

Returns

array