Skip to content

Route

Declares a route on an action class.

Placed on the class (not a method): Quiote’s model is one action class exposing multiple HTTP-verb methods (executeRead/executeWrite/…), the opposite of Symfony MVC’s one controller/many route methods, so a class can carry one or more of these. module/action are deliberately not fields here — they’re derived from the class’s location by AttributeRouteScanner, the same way Controller::createActionInstance() derives a class from a module/action pair, just in reverse.

final class Route

Since1.0.0
SourceRouting/Attribute/Route.php
PropertyTypeDescription
$condition?``stringreadonly.
$defaultsarrayreadonly.
$host?``stringreadonly.
$methodsarrayreadonly.
$name?``stringreadonly.
$outputType?``stringreadonly.
$pathstringreadonly.
$priorityintreadonly.
$requirementsarrayreadonly.

public function __construct(string $path, string|null $name = null, array<string> $methods = [], array<string, string> $requirements = [], array<string, mixed> $defaults = [], string|null $host = null, string|null $condition = null, int $priority = 0, string|null $outputType = null): mixed

Quiote output type this route resolves to.

ParameterTypeDescription
$pathstringSymfony route path, e.g. ‘/products/{id}’.
$name`string““null`
$methodsarray``<``string``>HTTP methods this route accepts; empty means all.
$requirementsarray``<``string``, ``string``>Per-parameter regex requirements.
$defaultsarray``<``string``, ``mixed``>Extra route defaults, merged under module/action.
$host`string““null`
$condition`string““null`
$priorityintRoute priority (higher matches first).
$outputType`string““null`

Returns mixed