API / Minn\Blocks / Context

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

privatearray $postStack
private?Minn\Content\CommentRecord $comment
propreadonly Minn\Front\Resolution $resolution

Promoted from the constructor.

propreadonly array $posts

Promoted from the constructor.

propreadonly int $total

Promoted from the constructor.

propreadonly int $perPage

Promoted from the constructor.

propreadonly bool $front

Promoted from the constructor.

Public

new__construct(Minn\Front\Resolution $resolution, array $posts, int $total, int $perPage, bool $front)#
$postslist<PostRecord>the main query's page of posts
staticforRest(): self#

A context for rendering outside a page: the home resolution and no posts.

methodpost(): ?Minn\Content\PostRecord#

The post being rendered, innermost first.

methodpushPost(Minn\Content\PostRecord $post): void#

Enters a post's scope.

methodpopPost(): void#

Leaves the innermost post's scope.

methodinLoop(): bool#

Inside a post template loop (as opposed to the singular view).

methodcomment(): ?Minn\Content\CommentRecord#

The comment being rendered, if any.

methodwithComment(?Minn\Content\CommentRecord $comment): void#

Enters or leaves a comment's scope.

methodpaged(): int#

The page number being rendered.

methodtotalPages(): int#

How many pages the listing makes.