Documentation

RouteTrait

Table of Contents

$route  : RouteCollection|Route
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 pattern for the host.
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

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 pattern for the host.

public final host(string $pattern) : $this
Parameters
$pattern : string
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