Skip to content

AttributeRoutes

Entry point for combining #[Route]-attributed actions with hand-written routes in the same Routing subclass.

Attribute routing (Quiote\Routing\AttributeRouting) and programmatic/file-based routing (a plain Routing::build() like samples/app’s AppRouting) are not mutually exclusive: a Routing::build() implementation can add its own routes to a RouteCollection by hand and then call mergeInto() to pull in every #[Route]-attributed action on top, all in one RouteCollection + meta pair.

final class AttributeRoutes

Since1.0.0
SourceRouting/AttributeRoutes.php
MethodDescription
[`mergeInto(RouteCollection $routes, array<string, array{gen_path: string, cut: bool, path: string}> &$meta, iterablenull $moduleDirs = null): array`](#mergeinto)

public static function mergeInto(RouteCollection $routes, array<string, array{gen_path: string, cut: bool, path: string}> &$meta, iterable<string>|null $moduleDirs = null): array<Diagnostic>

Defaults to [core.module_dir].

ParameterTypeDescription
$routesRouteCollection
$metaarray``<``string``, ``array{gen_path: string, cut: bool, path: string}``>
$moduleDirs`iterable<string>“null`

Returns array``<Diagnostic> — Diagnostics recorded while scanning (duplicate route names/paths among the attribute routes themselves — collisions against the hand-written routes already in $routes are not detected here, same as two hand-written addRoute() calls with the same name silently overwriting each other).