API / Minn\Admin / AppController

AppController final readonly class

Minn\Admin\AppController · public/minn/src/Minn/Admin/AppController.php · 149 lines

Serves Minn Admin from the engine: the path-routed shell (every sub-path renders the same page) and the app's assets. The nonce refresh app.js asks admin-ajax.php for is the reference's own rest-nonce action (Runtime\AjaxController).

Used by 1

Constants and properties

privatereadonly Minn\Admin\App $app

Promoted from the constructor.

privatereadonly Minn\Admin\BootPayload $payload

Promoted from the constructor.

privatereadonly Minn\Auth\Authenticator $authenticator

Promoted from the constructor.

privatereadonly Minn\Auth\Capabilities $capabilities

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly string $engineVersion

Promoted from the constructor.

privatereadonly Minn\Content\SiteIcon $icon

Promoted from the constructor.

privatereadonly bool $off

the site has deactivated the Minn Admin plugin: the engine runs without an admin

Promoted from the constructor.

Public

new__construct(Minn\Admin\App $app, Minn\Admin\BootPayload $payload, Minn\Auth\Authenticator $authenticator, Minn\Auth\Capabilities $capabilities, Minn\Front\Permalinks $permalinks, string $engineVersion, Minn\Content\SiteIcon $icon, bool $off = false)#
methodshell(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin (public)GET /minn-admin/{rest*} (public)#

Requires a signed-in user who can edit content; otherwise the login form.

methodasset(Minn\Http\Request $request, string $path): Minn\Http\ResponseGET /minn/admin/assets/{path*} (public)#

One file of the app bundle, with its content type and caching headers.

Internals 3

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

privateoffPage(): string#

The engine without an admin: the site keeps serving; the command that brings the admin back is named.

privatefavicon(): string#

The tab's icon, chosen as Minn Admin's own shell chooses it: the site icon when there is one, else a brand mark a theme or plugin offers on minn_admin_favicon, else Minn's "m" in the viewer's accent (Minn Admin's own drawing when it runs as code, its default accent if not). Without one the browser asks for /favicon.ico.

privaterender(array $boot): string#

The shell reproduces the structure of Minn Admin's own template.php (an MIT file): pre-paint theme, inline window.MINN, mount point, app.js.