API / Minn\Admin / RenderController

RenderController final readonly class

Minn\Admin\RenderController · public/minn/src/Minn/Admin/RenderController.php · 52 lines

The editor's island previews: block markup rendered by the same renderer the public site uses, with the stylesheets that site loads (the engine's block stylesheet, the theme's, and the theme.json rules) so a preview looks like the page will.

Used by 1

Constants and properties

privatereadonly Minn\Db $db

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Content\Posts $posts

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

privatereadonly string $themesDir

Promoted from the constructor.

Public

new__construct(Minn\Db $db, Minn\Content\Site $site, Minn\Content\Posts $posts, Minn\Front\Permalinks $permalinks, Minn\Rest\Caller $caller, string $themesDir)#
methodrender(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/render-blocks (floor edit_posts)#

Renders blocks for the editor's preview.

methodeditorStyles(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/editor-styles (floor edit_posts)#

The stylesheets previews are scoped under: the engine's own, the theme's, and theme.json inline.

Internals 1

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

privatestyles(): array#
@return array{urls: list<string>, inline: string}