Documentation

RouteConfigurator
in package
Uses AddTrait, HostTrait, RouteTrait

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

$collection  : RouteCollection
$name  : mixed
$parentConfigurator  : mixed
$prefixes  : mixed
$route  : RouteCollection|Route
__construct()  : mixed
__invoke()  : RouteConfigurator
Adds a route.
add()  : RouteConfigurator
Adds a route.
alias()  : AliasConfigurator
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.
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.

Properties

Methods

__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

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

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

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

Search results