RuleRoutes final readonly class
Minn\Front\RuleRoutes · public/minn/src/Minn/Front/RuleRoutes.php · 156 lines
What a matched rewrite rule's query vars name, as the reference's main query reads them (suites permalinks, plugin-rules, request-vars): a post or page by id, an attachment by name, a page (or an attachment) by its path, a post by name (of the type the vars give), a registered type's item by its own var; else a search, a category's, tag's, post format's or registered taxonomy's archive, an author's, a date's, a post type's; else the front. A rule that set error is a 404, as is a single the reader may not read. Under a name the date or category the rule also captured does not narrow the find: where the post really lives is the canonical redirect's business.
Constants and properties
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Front\ArchiveAddresses $archives | Promoted from the constructor. |
| private | readonly int $frontPageId | Promoted from the constructor. |
| private | readonly int $postsPageId | Promoted from the constructor. |
| private | readonly Closure $readable | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Posts $posts, Minn\Front\ArchiveAddresses $archives, int $frontPageId, int $postsPageId, Closure $readable)# |
| |||
| method | resolve(array $vars): Minn\Front\Resolution# | The resolution the vars stand for. @param array<string, string> $vars
|
Internals 7
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | single(array $vars, string $type, int $paged): ?Minn\Front\Resolution# | A single the vars name; null when they name none. @param array<string, string> $vars
| |||
| private | archive(array $vars, string $type, int $paged): Minn\Front\Resolution# | The archive the vars name, the front when they name none: a search first (whatever else they name, as the reference's templates choose), a term's, an author's, a date's, a post type's when they give one and nothing else.
| |||
| private | typeArchive(string $name, int $paged): Minn\Front\Resolution# | A post type's archive, when it has one; the front's listing (of that type) when it has none. | |||
| private | found(?Minn\Content\PostRecord $post, int $paged): Minn\Front\Resolution# | A found post as the reader may see it: the static front page, the posts page (the blog's listing), any other post or page; a 404 when there is none or the reader may not read it (an attachment as its parent is). | |||
| private | readable(Minn\Content\PostRecord $post): bool# | Whether the reader may read a post; an attachment as its parent is, a loose one as it stands. | |||
| private | registered(string $kind): array# | The registered post types or taxonomies that answer to a var of their own, among those a visitor may query (the reference keeps no other's var public): name => var. @return array<string, string> | |||
| private | segments(string $path): array# | @return list<string> |
Nothing matches.