Documentation

RouteDef
in package

Read onlyYes
FinalYes

A route definition.

It was necessary to introduce the dual concept of a route and of a route definition. This is because some parts of the application are only concerned with defining an exclusive set of URL paths (a route definition) in order to provide informations about them, including how to respond to them. Meanwhile, the actual route matches only specific path (a route) and is instantiated at runtime necessarily.

Unlike Route-s, a RouteDef only knows about its direct descendants not about its parent.

Tags
todo

Make it implement ArrayAccess to access sub-route definitions.

Table of Contents

Properties

$fqcn  : string|null
$fqcnIfParams  : string|null
$nArgsLowerLimit  : int
$nArgsUpperLimit  : int
$pageParam  : PageConf|null
$roles  : array<string|int, mixed>
$subroutes  : array<string|int, mixed>

Methods

__construct()  : mixed

Properties

$fqcnIfParams

public string|null $fqcnIfParams = null

$nArgsLowerLimit

public int $nArgsLowerLimit = 0

$nArgsUpperLimit

public int $nArgsUpperLimit = 0

$roles

public array<string|int, mixed> $roles = []

$subroutes

public array<string|int, mixed> $subroutes = []

Methods

__construct()

public __construct(IRoutedController>|null $fqcn, PageConf : null)) $pageParam[, array<int, string> $roles = [] ][, array<string, self> $subroutes = [] ][, int $nArgsLowerLimit = 0 ][, int $nArgsUpperLimit = 0 ][, IRoutedController>|null $fqcnIfParams = null ]) : mixed
Parameters
$fqcn : IRoutedController>|null

The FQCN of the controller responsible for this particular partition of paths. If null, this route definition only serves to set the paths of sub route definitions, set shared roles, etc.

$pageParam : PageConf : null))

Parameters for the page, required if the route def has an associated controller ($fqcn or $fqcnIfParams).

$roles : array<int, string> = []

Required roles to access this route.

$subroutes : array<string, self> = []

The child routes as an array of route definitions, indexed by the path segment through which they are accessed.

$nArgsLowerLimit : int = 0
$nArgsUpperLimit : int = 0
$fqcnIfParams : IRoutedController>|null = null

The controller if the route has parameters.

Tags
todo

What happens when an object argument has a default???

On this page

Search results