ArchiveAddresses final readonly class
Minn\Front\ArchiveAddresses · public/minn/src/Minn/Front/ArchiveAddresses.php · 97 lines
The archives an address may stand for, as the reference answers them: the front, a search, a term's (a category's, a tag's, a plugin taxonomy's), an author's and a date's. Each is the archive when what it names exists (a term by its path's last slug, a valid date; an author's for any name); whether its page has posts is the main query's to say, and an empty page past the first, or an empty date, is the 404 it decides (Theme\FrontLifecycle::handle404).
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Content\Terms $terms | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Closure $readable | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Content\Posts $posts, Minn\Content\Terms $terms, Minn\Front\Permalinks $permalinks, Closure $readable)# |
| |||
| method | search(string $term, int $paged): Minn\Front\Resolution# | A search's results page. | |||
| method | home(int $paged): Minn\Front\Resolution# | The front: the static front page when there is one, else the posts listing. | |||
| method | taxonomy(string $taxonomy, array $slugs, int $paged): Minn\Front\Resolution# | A plugin taxonomy's term archive by its path; a 404 when no term is at that path.
| |||
| method | term(string $taxonomy, array $slugs, int $paged): Minn\Front\Resolution# | A category's or tag's archive by its path; a 404 when no term is at that path. @param list<string> $slugs
| |||
| method | author(string $name, int $paged): Minn\Front\Resolution# | An author's archive by nicename: the archive for any name, the author's when one has it. | |||
| method | date(array $segments, int $paged): Minn\Front\Resolution# | A date archive by year, month and day; a 404 when the date is not one. @param list<string> $segments
| |||
| static | isDate(int $year, ?int $month, ?int $day): bool# | Whether a year, month and day (the last two optional, a day only with its month) name a date. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | at(string $taxonomy, array $slugs): ?Minn\Content\TermRecord# | The term a slug path names: its last slug's, whatever the segments before it say (the reference serves /category/any/child/ as the child's archive, unmoved).
|
Nothing matches.