RouteCollection
extends BaseFoundationCollection
in package
FinalYes
The RouteCollection contains all the page routes, making it the pseudo-router for Hyde, as it maps each page to the eventual URL that will be used to access it once built.
Tags
Table of Contents
Properties
- $items : array<string, Route>
- $kernel : HydeKernel
Methods
- addRoute() : void
- boot() : static
- get() : Route|null
- getRoute() : Route
- getRoutes() : RouteCollection
- init() : static
- __construct() : mixed
- runDiscovery() : void
- runExtensionHandlers() : void
- setKernel() : $this
Properties
$items
public
array<string, Route>
$items
The routes in the collection.
$kernel
protected
HydeKernel
$kernel
Methods
addRoute()
public
addRoute(Route $route) : void
Parameters
- $route : Route
boot()
public
final boot() : static
Return values
staticget()
public
get([string $key = ][, Route $default = null ]) : Route|null
Parameters
- $key : string =
- $default : Route = null
Return values
Route|nullgetRoute()
public
getRoute(string $routeKey) : Route
Parameters
- $routeKey : string
Return values
RoutegetRoutes()
public
getRoutes([HydePage>|null $pageClass = null ]) : RouteCollection
Parameters
- $pageClass : HydePage>|null = null
Return values
RouteCollectioninit()
public
static init(HydeKernel $kernel) : static
Parameters
- $kernel : HydeKernel
Return values
static__construct()
protected
final __construct([array<string|int, mixed>|Arrayable|null $items = [] ]) : mixed
Parameters
- $items : array<string|int, mixed>|Arrayable|null = []
runDiscovery()
protected
runDiscovery() : void
runExtensionHandlers()
protected
runExtensionHandlers() : void
setKernel()
protected
setKernel(HydeKernel $kernel) : $this
Parameters
- $kernel : HydeKernel