IndexController final readonly class
Minn\Rest\IndexController · public/minn/src/Minn/Rest/IndexController.php · 106 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. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Rest\RestUrl $url, Minn\Rest\RouteCatalogue $catalogue, Minn\Rest\Caller $caller)# | |
| 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. The namespace argument the index lists takes the path's place when it is sent, as every path argument does on the reference: one naming no namespace the engine serves is rest_invalid_namespace. |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | imageSettings(Minn\Http\Request $request): array# | How the browser processes images before upload, for someone who may upload when it does: the registered sizes, the big-image threshold, whether metadata is stripped and the deepest bit depth kept, each through its filter as the editor hears it. @return array<string, mixed> |
| private | themeLink(): array# | The active theme's link, for someone who may switch themes, manage the network's or edit posts, as the reference links it (with the curies its relation needs). @return array<string, mixed> |
Nothing matches.