PageRenderer final readonly class
Minn\Theme\PageRenderer · public/minn/src/Minn/Theme/PageRenderer.php · 185 lines
A whole page from the active block theme: the template the resolution maps to, rendered against the main query, inside the document shell the reference emits (skip link, wp-site-blocks, the skip-link target on the first main element).
Uses 27 (show)
Constants and properties
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Theme\Theme $theme | Promoted from the constructor. |
| private | readonly Minn\Theme\Templates $templates | Promoted from the constructor. |
| private | readonly Minn\Blocks\Renderer $renderer | Promoted from the constructor. |
| private | readonly Minn\Theme\MainQueryBridge $bridge | Promoted from the constructor. |
| private | readonly Minn\Theme\HeadLinks $headLinks | Promoted from the constructor. |
| private | readonly ?Minn\Front\AdminBar $bar | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Site $site, Minn\Theme\Theme $theme, Minn\Theme\Templates $templates, Minn\Blocks\Renderer $renderer, Minn\Theme\MainQueryBridge $bridge, Minn\Theme\HeadLinks $headLinks, ?Minn\Front\AdminBar $bar = NULL)# | |
| static | create(Minn\Db $db, Minn\Theme\Theme $theme, Minn\Front\Permalinks $permalinks, int $perPage, ?Minn\Front\AdminBar $bar = NULL): self# | A page renderer over the database door. |
| method | bodyClasses(Minn\Front\Resolution $resolution, array $coreClasses): array# | The reference's body-class tokens: the singular and template tokens sit in front of the type token ("page", "single"), the custom-logo and embed tokens follow the core set, the paging tokens come after those, and the theme (and child theme) tokens close the list; then the body_class filter. @return list<string> |
| method | themeClasses(Minn\Front\Resolution $resolution, array $coreClasses): array# | The body-class tokens before plugins filter them (bodyClasses()). @return list<string> @return list<string> |
| method | render(Minn\Front\Resolution $resolution, array $coreClasses): ?string# | The page for a resolution, or null when the theme has no template for it. |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | document(Minn\Front\Resolution $resolution, array $coreClasses, array $template, Minn\Content\Page $query): string# | The block template's document: the blocks rendered, the head, the body classes, the footer.
| |||
| private | skipLinkTarget(string $body): array# | The skip link points at the first <main>: at its own id when the template gave it one, otherwise at the id the reference injects. @return array{string, string} the body, the target id | |||
| private | head(Minn\Front\Resolution $resolution, Minn\Theme\GlobalStyles $styles, ?Minn\Front\AdminBar $bar): string# | The head: the charset, then wp_head (the viewport, robots, title and discovery links from the reference's defaults, which a plugin may remove; the engine's stylesheets inside it, where the reference prints a theme's, after plugin styles), then the extension head (after the stylesheets, as the seam contract says), the bar's own. |
Nothing matches.