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.
Synopsis
Section titled “Synopsis”final class Route
| Since | 1.0.0 |
| Source | Routing/Attribute/Route.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$condition | ?``string | readonly. |
$defaults | array | readonly. |
$host | ?``string | readonly. |
$methods | array | readonly. |
$name | ?``string | readonly. |
$outputType | ?``string | readonly. |
$path | string | readonly. |
$priority | int | readonly. |
$requirements | array | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”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.
| Parameter | Type | Description |
|---|---|---|
$path | string | Symfony route path, e.g. ‘/products/{id}’. |
$name | `string“ | “null` |
$methods | array``<``string``> | HTTP methods this route accepts; empty means all. |
$requirements | array``<``string``, ``string``> | Per-parameter regex requirements. |
$defaults | array``<``string``, ``mixed``> | Extra route defaults, merged under module/action. |
$host | `string“ | “null` |
$condition | `string“ | “null` |
$priority | int | Route priority (higher matches first). |
$outputType | `string“ | “null` |
Returns mixed