Skip to content
docsv0.1.0

DashboardHtmlRenderer

HTML {@see ComponentRendererInterface} for the dashboard-primitive contract family — shell, sidebar, main, topbar, grid, panel, page header, action button, alert list, metric card, and data table. One renderer fans out to a private per-primitive method (`shell()`, `sidebar()`, …) that builds the Latte params for that primitive's template; the public surface stays the single {@see render()} entrypoint every primitive shares via its contract name.

DashboardHtmlRenderer::__construct()

public function __construct(Milpa\Live\Contracts\Client\ClientRuntimeAdapterInterface $client, Milpa\Live\Contracts\Transport\StateTransferCodecInterface $codec, ?Milpa\Live\Contracts\Rendering\TemplateRendererInterface $templates = null, ?Milpa\Interfaces\Event\MilpaEventDispatcherInterface $dispatcher = null):

Parameters

Parameters of __construct()
NameTypeDescription
$clientMilpa\Live\Contracts\Client\ClientRuntimeAdapterInterface
$codecMilpa\Live\Contracts\Transport\StateTransferCodecInterface
$templates?Milpa\Live\Contracts\Rendering\TemplateRendererInterface
$dispatcher?Milpa\Interfaces\Event\MilpaEventDispatcherInterface

DashboardHtmlRenderer::supportsTarget()

public function supportsTarget(Milpa\Live\ValueObjects\RenderTarget $target): bool

True only for {@see RenderTarget::HTML} — this renderer produces server-rendered markup, not another target format.

Parameters

Parameters of supportsTarget()
NameTypeDescription
$targetMilpa\Live\ValueObjects\RenderTarget

DashboardHtmlRenderer::render()

public function render(Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component, Milpa\Live\ValueObjects\RenderRequest $request): Milpa\Live\ValueObjects\RenderResult

Renders one dashboard-primitive component to HTML, dispatching on the component's contract name to the matching private builder (`shell()`, `sidebar()`, `main()`, …). Throws `InvalidArgumentException` if the contract name is outside {@see self::SUPPORTED}.

Parameters

Parameters of render()
NameTypeDescription
$componentMilpa\Live\Contracts\Component\ComponentDefinitionInterface
$requestMilpa\Live\ValueObjects\RenderRequest