ListingLinks final class
Minn\Front\ListingLinks · public/minn/src/Minn/Front/ListingLinks.php · 53 lines
The prev/next links a paged listing prints: which page sits either side of the one being read, and the anchor that points at it. Posts listings and comment threads both come through here; only the URL builder differs.
Public
| static | neighbours(int $current, int $maxPages): array# | The page before and after the current one, null past either end. A listing of one page has neither, which is how the navigation blocks know to print nothing at all. @return array{0: ?int, 1: ?int} |
| static | anchor(string $url, string $attributes, string $text): string# | The anchor the reference prints. Attributes go in verbatim after the href, and the space that separates them stays even when a caller supplied none, so the markup reads `<a href="..." >text</a>`. |
| static | label(string $label, string $default): string# | A navigation label's bare ampersands become entities, while an ampersand that already opens an entity is left as it is. |
| static | bareCommentPage(string $defaultPage, int $maxPages): int# | Which page of a comment thread the bare permalink shows: the first when the site reads oldest comments first, the last when it reads newest first. Every other page carries a comment-page-N segment. The page count is whatever the caller passed and is never filled in from the query: a caller that does not say how long the thread is gets no collapse at all under newest-first, because no page matches an unknown last page. |
Nothing matches.