Skip to content
docsv0.1.0

ComponentRenderingEvent

PRE event: a component is about to be rendered via {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface::render()}. Dispatched as `component.rendering`, ALWAYS alongside a {@see \Milpa\Events\InterceptionSlot} — a plugin may short-circuit with a replacement {@see \Milpa\Live\ValueObjects\RenderResult} to decorate or wholly replace the renderer's own output (e.g. injecting a banner, swapping in a cached render for this target). Readonly; the mutable escape hatch lives entirely in the slot dispatched alongside this event. See {@see \Milpa\Live\Events\LiveEventEmitter::withRendering()} for the exact short-circuit/veto/passthrough contract.

ComponentRenderingEvent::__construct()

public function __construct(string $componentName, Milpa\Live\ValueObjects\RenderRequest $request):

Parameters

Parameters of __construct()
NameTypeDescription
$componentNamestringThe component contract's registered name.
$requestRenderRequestThe render request about to be fulfilled.