IndexController final readonly class
Minn\Rest\IndexController · public/minn/src/Minn/Rest/IndexController.php · 56 lines
The API index at /wp-json/: the site facts monitors read (name, url, home, namespaces) and the routes this engine serves, described from its own router rather than the reference's full schema; and the index of one namespace at /wp-json/{namespace}, the same routes narrowed.
Constants and properties
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly Minn\Rest\RouteCatalogue $catalogue | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Rest\RestUrl $url, Minn\Rest\RouteCatalogue $catalogue)# | |
| method | index(Minn\Http\Request $request): Minn\Http\ResponseGET / (public)# | The REST index: namespaces, routes, and the site's description. |
| method | namespaceIndex(Minn\Http\Request $request, string $namespace): Minn\Http\ResponseGET /{namespace:[a-z0-9-]+/(?:v\d+|\d+\.\d+)} (public)# | One namespace's index, as the reference answers /wp-json/wp/v2 (or oembed/1.0): the namespace, its routes (the namespace root among them), and the link up to the root index. A namespace the engine does not serve is left to the runtime, whose plugins may own it. |
Nothing matches.