Skip to content
docsv0.34.0

ShellRender

The mutable subject of the shell's render lifecycle. `admin.shell.before_render` hands out the XHTML composition and the sidebar items before the compiler runs; `admin.shell.after_render` hands out the HTML before the page wraps it. The items are flat: each carries the sidebar `group` it lists under (the section's, or `app` for an item a subscriber adds without one) and the sidebar groups them when it mounts — so a subscriber adds an item and names its group, and never rebuilds the groups. An item may also carry `children`: the sections declared UNDER it, which the sidebar paints behind a gear instead of listing beside their parent. They travel with the item that owns them so a subscriber can add or remove one without holding the catalogue (greenhouse decisions/0268).

ShellRender::__construct()

public function __construct(string $markup, array $items, string $html = ''):

Parameters

Parameters of __construct()
NameTypeDescription
$markupstringthe `<milpa:…>` composition — mutable before render
$itemslist<array{key: string, label: string, href: string, icon: string, group?: string, children?: list<array{key: string, label: string, href: string, icon: string}>}>the sidebar items, in sidebar order — mutable before render
$htmlstringthe rendered shell — mutable after render