Route Collections
Introduction
Class Synopsis
class RouteCollection
{
constructor(string prefix, array routes = [], array collections = []);
addRoute(Route route);
addRoutes(Route[] routes);
addCollection(RouteCollection collection);
addCollections(RouteCollection[] collections);
findRouteByPath(string path);
findRouteByName(string name, bool deep = false);
findCollectionByPrefix(string prefix);
getRoutes() : Route[];
getCollections() : RouteCollection[];
getFlattenedRoutes() : Route[];
getFlattenedCollections() : RouteCollection[];
getPathPrefix() : string;
getParentCollection() : RouteCollection|null;
setPathPrefix(string prefix);
setParentCollection(RouteCollection collection);
}Examples
Example: Grouping routes with a shared path prefix
Example: Chaining collections declaratively
Example: Chaining collections imperatively
Last updated