TemplateObject final readonly class
Minn\Rest\TemplateObject · public/minn/src/Minn/Rest/TemplateObject.php · 101 lines
The wp/v2/templates and wp/v2/template-parts resource.
Used by 2
Constants and properties
| private | readonly Minn\Theme\TemplateIndex $index | Promoted from the constructor. |
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Rest\RestUrl $url | Promoted from the constructor. |
| private | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Theme\TemplateIndex $index, Minn\Content\Posts $posts, Minn\Rest\RestUrl $url, Minn\Rest\Caller $caller)# | |
| method | base(string $type): string# | The rest_base of a template type. |
| method | view(Minn\Theme\TemplateRecord $record, Minn\Rest\Context $context, ?string $as = NULL): array# | The wp/v2 template shape. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | links(Minn\Theme\TemplateRecord $record, string $as): array# | The write links and their curies show only to a caller who could use them; a reader who may list templates but not change them sees a self link that allows GET and nothing else. |
Nothing matches.