CollectionConfigurator
in package
Uses
AddTrait, HostTrait, RouteTrait
Tags
Table of Contents
- $collection : RouteCollection
- $name : mixed
- $prefixes : mixed
- $route : RouteCollection|Route
- $host : mixed
- $parent : mixed
- $parentConfigurator : mixed
- $parentPrefixes : mixed
- __construct() : mixed
- __destruct() : mixed
- __invoke() : RouteConfigurator
- Adds a route.
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- add() : RouteConfigurator
- Adds a route.
- alias() : AliasConfigurator
- collection() : self
- Creates a sub-collection.
- condition() : $this
- Sets the condition.
- controller() : $this
- Adds the "_controller" entry to defaults.
- defaults() : $this
- Adds defaults.
- format() : $this
- Adds the "_format" entry to defaults.
- host() : $this
- Sets the host to use for all child routes.
- locale() : $this
- Adds the "_locale" entry to defaults.
- methods() : $this
- Sets the HTTP methods (e.g. 'POST') this route is restricted to.
- options() : $this
- Adds options.
- prefix() : $this
- Sets the prefix to add to the path of all child routes.
- requirements() : $this
- Adds requirements.
- schemes() : $this
- Sets the schemes (e.g. 'https') this route is restricted to.
- stateless() : $this
- Adds the "_stateless" entry to defaults.
- utf8() : $this
- Whether paths should accept utf8 encoding.
- createRoute() : Route
Properties
$collection
protected
RouteCollection
$collection
$name
protected
mixed
$name
= ''
$prefixes
protected
mixed
$prefixes
$route
protected
RouteCollection|Route
$route
$host
private
mixed
$host
$parent
private
mixed
$parent
$parentConfigurator
private
mixed
$parentConfigurator
$parentPrefixes
private
mixed
$parentPrefixes
Methods
__construct()
public
__construct(RouteCollection $parent, string $name[, self|null $parentConfigurator = null ][, array<string|int, mixed>|null $parentPrefixes = null ]) : mixed
Parameters
- $parent : RouteCollection
- $name : string
- $parentConfigurator : self|null = null
- $parentPrefixes : array<string|int, mixed>|null = null
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —__invoke()
Adds a route.
public
__invoke(string $name, string|array<string|int, mixed> $path) : RouteConfigurator
Parameters
- $name : string
- $path : string|array<string|int, mixed>
-
the path, or the localized paths of the route
Return values
RouteConfigurator —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —add()
Adds a route.
public
add(string $name, string|array<string|int, mixed> $path) : RouteConfigurator
Parameters
- $name : string
- $path : string|array<string|int, mixed>
-
the path, or the localized paths of the route
Return values
RouteConfigurator —alias()
public
alias(string $name, string $alias) : AliasConfigurator
Parameters
- $name : string
- $alias : string
Return values
AliasConfigurator —collection()
Creates a sub-collection.
public
final collection([string $name = '' ]) : self
Parameters
- $name : string = ''
Return values
self —condition()
Sets the condition.
public
final condition(string $condition) : $this
Parameters
- $condition : string
Return values
$this —controller()
Adds the "_controller" entry to defaults.
public
final controller(callable|string|array<string|int, mixed> $controller) : $this
Parameters
- $controller : callable|string|array<string|int, mixed>
-
a callable or parseable pseudo-callable
Return values
$this —defaults()
Adds defaults.
public
final defaults(array<string|int, mixed> $defaults) : $this
Parameters
- $defaults : array<string|int, mixed>
Return values
$this —format()
Adds the "_format" entry to defaults.
public
final format(string $format) : $this
Parameters
- $format : string
Return values
$this —host()
Sets the host to use for all child routes.
public
final host(string|array<string|int, mixed> $host) : $this
Parameters
- $host : string|array<string|int, mixed>
-
the host, or the localized hosts
Return values
$this —locale()
Adds the "_locale" entry to defaults.
public
final locale(string $locale) : $this
Parameters
- $locale : string
Return values
$this —methods()
Sets the HTTP methods (e.g. 'POST') this route is restricted to.
public
final methods(array<string|int, string> $methods) : $this
So an empty array means that any method is allowed.
Parameters
- $methods : array<string|int, string>
Return values
$this —options()
Adds options.
public
final options(array<string|int, mixed> $options) : $this
Parameters
- $options : array<string|int, mixed>
Return values
$this —prefix()
Sets the prefix to add to the path of all child routes.
public
final prefix(string|array<string|int, mixed> $prefix) : $this
Parameters
- $prefix : string|array<string|int, mixed>
-
the prefix, or the localized prefixes
Return values
$this —requirements()
Adds requirements.
public
final requirements(array<string|int, mixed> $requirements) : $this
Parameters
- $requirements : array<string|int, mixed>
Return values
$this —schemes()
Sets the schemes (e.g. 'https') this route is restricted to.
public
final schemes(array<string|int, string> $schemes) : $this
So an empty array means that any scheme is allowed.
Parameters
- $schemes : array<string|int, string>
Return values
$this —stateless()
Adds the "_stateless" entry to defaults.
public
final stateless([bool $stateless = true ]) : $this
Parameters
- $stateless : bool = true
Return values
$this —utf8()
Whether paths should accept utf8 encoding.
public
final utf8([bool $utf8 = true ]) : $this
Parameters
- $utf8 : bool = true
Return values
$this —createRoute()
private
createRoute(string $path) : Route
Parameters
- $path : string