API / Minn\Admin / ThemesController

ThemesController final readonly class

Minn\Admin\ThemesController · public/minn/src/Minn/Admin/ThemesController.php · 99 lines

The theme inventory of minn-admin/v1: every theme on disk with its headers, screenshot, and update offer, and the switch of the active one.

Used by 1

Constants and properties

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Ops\Updates $updates

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

privatereadonly string $contentDir

Promoted from the constructor.

Public

new__construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Ops\Updates $updates, Minn\Rest\Caller $caller, string $contentDir)#
methodthemes(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/themes (floor edit_posts)#

Every theme on disk with the active one marked.

methodactivateTheme(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/themes/activate (floor edit_posts + switch_themes)#

Switches the active theme.

Internals 3

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

privatethemeText(string $value): string#

A theme header as the reference serves it: tags stripped, a bare ampersand entity-encoded.

privatethemeFolders(): array#
@return array<string, array<string, string>> slug => style.css headers
privatescreenshot(string $slug): string#