Context final class
Minn\Blocks\Context · public/minn/src/Minn/Blocks/Context.php · 76 lines
What the template blocks render against: the resolution, the main query's posts, and a stack of "current post" frames pushed by post templates and comment templates as they loop.
Constants and properties
| private | array $postStack | |
| private | ?Minn\Content\CommentRecord $comment | |
| prop | readonly Minn\Front\Resolution $resolution | Promoted from the constructor. |
| prop | readonly array $posts | Promoted from the constructor. |
| prop | readonly int $total | Promoted from the constructor. |
| prop | readonly int $perPage | Promoted from the constructor. |
| prop | readonly bool $front | Promoted from the constructor. |
Public
| new | __construct(Minn\Front\Resolution $resolution, array $posts, int $total, int $perPage, bool $front)# |
| |||
| static | forRest(): self# | A context for rendering outside a page: the home resolution and no posts. | |||
| method | post(): ?Minn\Content\PostRecord# | The post being rendered, innermost first. | |||
| method | pushPost(Minn\Content\PostRecord $post): void# | Enters a post's scope. | |||
| method | popPost(): void# | Leaves the innermost post's scope. | |||
| method | inLoop(): bool# | Inside a post template loop (as opposed to the singular view). | |||
| method | comment(): ?Minn\Content\CommentRecord# | The comment being rendered, if any. | |||
| method | withComment(?Minn\Content\CommentRecord $comment): void# | Enters or leaves a comment's scope. | |||
| method | paged(): int# | The page number being rendered. | |||
| method | totalPages(): int# | How many pages the listing makes. |
Nothing matches.