API / Minn\Front / SitemapController

SitemapController final readonly class

Minn\Front\SitemapController · public/minn/src/Minn/Front/SitemapController.php · 65 lines

The sitemap index, its pages, and the two stylesheets, as the reference serves them: the request's sitemap variables stand in the main query and the sitemaps server answers at template_redirect (SitemapRequest), through every filter a plugin hooks, any provider it registers among them; what it does not print, the theme renders (a 404, or the page a stray address amounts to).

Constants and properties

privatereadonly Closure $notFound

Promoted from the constructor.

privatereadonly Minn\Theme\MainQueryBridge $bridge

Promoted from the constructor.

privatereadonly Closure $themed

Promoted from the constructor.

Public

new__construct(Closure $notFound, Minn\Theme\MainQueryBridge $bridge, Closure $themed)#
methodsitemapIndex(Minn\Http\Request $request): Minn\Http\ResponseGET /wp-sitemap.xml (public)#

The sitemap index.

methodsitemap(Minn\Http\Request $request, string $name, string $rest): Minn\Http\ResponseGET /wp-sitemap-{name:[a-z]+}-{rest:[a-z_0-9-]+}.xml (public)#

One sitemap page: a provider's name, its subtype when it has them, and the page.

methodsitemapStylesheet(Minn\Http\Request $request): Minn\Http\ResponseGET /wp-sitemap.xsl (public)#

The sitemap stylesheet.

methodsitemapIndexStylesheet(Minn\Http\Request $request): Minn\Http\ResponseGET /wp-sitemap-index.xsl (public)#

The sitemap index stylesheet.

methodqueried(Minn\Http\Request $request): Minn\Http\Response#

The query form (?sitemap=, ?sitemap-stylesheet=) on the front page, with plugins loaded.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateserved(array $vars): Minn\Http\Response#

The reference's answer: what the sitemaps server printed, else the theme's page on the query as it stands (a 404 when the server made it one).

$varsarray<string, mixed>