API / Minn\Front / Resolution

Resolution final readonly class

Minn\Front\Resolution · public/minn/src/Minn/Front/Resolution.php · 116 lines

The outcome of resolving a public URL: which kind of thing it names, the record behind it, the page number for paginated views, and the query vars of the rewrite rule the address matched (what the request parse hands plugins). Redirects carry their target instead.

Constants and properties

propreadonly Minn\Front\Kind $kind

Promoted from the constructor.

propreadonly Minn\Content\PostRecord|Minn\Content\UserRecord|Minn\Content\TermRecord|array|null $record

Promoted from the constructor.

propreadonly int $paged

Promoted from the constructor.

propreadonly ?string $location

Promoted from the constructor.

propreadonly int $status

Promoted from the constructor.

propreadonly ?string $search

Promoted from the constructor.

propreadonly ?array $date

Promoted from the constructor.

propreadonly ?string $authorName

Promoted from the constructor.

propreadonly bool $front

the static front page (show_on_front = page), rendered as a page that is also home

Promoted from the constructor.

propreadonly bool $preview

a preview: the reader's autosave replaces the stored content

Promoted from the constructor.

propreadonly bool $postsPage

the posts page (page_for_posts): the record is the page, the listing is the blog

Promoted from the constructor.

propreadonly array $vars

Promoted from the constructor.

Public

new__construct(Minn\Front\Kind $kind, Minn\Content\PostRecord|Minn\Content\UserRecord|Minn\Content\TermRecord|array|null $record = NULL, int $paged = 1, ?string $location = NULL, int $status = 200, ?string $search = NULL, ?array $date = NULL, ?string $authorName = NULL, bool $front = false, bool $preview = false, bool $postsPage = false, array $vars = array ( ))#
$recordarray<string, mixed>|PostRecord|UserRecord|nullthe post, term, or user row
$datearray{0: int, 1: ?int, 2: ?int}|nullyear, month, day
methodasPreview(): self#

The same resolution marked as a preview.

methodwithVars(array $vars): self#

The same resolution reached through a rule with these query vars. @param array<string, string> $vars

$varsarray<string, string>
statichome(int $paged = 1): self#

The home listing.

staticsingle(Minn\Content\PostRecord $post, int $paged = 1): self#

A single post or page.

staticfrontPage(Minn\Content\PostRecord $page, int $paged = 1): self#

The static front page.

staticpostsPage(Minn\Content\PostRecord $page, int $paged = 1): self#

The page that stands for the blog: a home listing whose record is the page.

staticterm(string $taxonomy, Minn\Content\TermRecord $term, int $paged = 1): self#

A category or tag archive.

statictaxonomy(Minn\Content\TermRecord $term, int $paged = 1): self#

A plugin taxonomy's term archive; the record is the term row (with its taxonomy).

staticpostTypeArchive(array $type, int $paged = 1): self#

A plugin post type's archive; the record is the registered type (name, label, ...).

staticauthor(string $name, ?Minn\Content\UserRecord $user, int $paged = 1): self#

An author archive.

staticdate(int $year, ?int $month, ?int $day, int $paged = 1): self#

A date archive.

staticsearch(string $term, int $paged = 1): self#

A search.

staticnotFound(): self#

A 404.

staticredirect(string $location, int $status = 301): self#

A redirect.

methodid(): int#

The record's id, post or term.