API / Minn\Rest / EngineRoutes

EngineRoutes final class

Minn\Rest\EngineRoutes · public/minn/src/Minn/Rest/EngineRoutes.php · 66 lines

The engine's own REST routes in the reference's regex form, for the index and for the runtime's server, whose route table plugin code reads to learn what the site answers (a missing /wp/v2/comments there reads as "comments are off").

Public

staticmap(Minn\Http\Router $router, array $declaredBases = array ( )): array#

The router's routes as route => methods, the way the index lists them.

$declaredBaseslist<string>the rest_base of every declared type
@return array<string, list<string>> route => methods
staticforms(string $pattern, array $declaredBases = array ( )): array#

A route attribute pattern as the reference writes routes: `{id:\d+}` becomes `(?P<id>\d+)`, a bare capture matches one segment, a `{rest*}` capture the remainder, and a literal constraint (`{base:posts}`, or the alternation `{base:posts|pages}`) expands to one route per literal. The declared-type routes are written once as a `{base:[...]}` catch-all; they list per declared type under its rest_base (as the reference lists a registered type) and not at all when no type is declared, so nothing listed answers no-route.

$declaredBaseslist<string>
@return list<string>