TuiComponentRenderer
Renders a Live component to the terminal, the counterpart of the HTML renderers in `milpa/live-web`. Same component definition, same state snapshot, different target — this is the seam that lets one component description serve both surfaces.
TuiComponentRenderer::__construct()
public function __construct(?Milpa\Live\Contracts\Tui\TerminalThemeInterface $theme = null, ?Milpa\Interfaces\Event\MilpaEventDispatcherInterface $dispatcher = null):Parameters
| Name | Type | Description |
|---|---|---|
| $theme | ?Milpa\Live\Contracts\Tui\TerminalThemeInterface | |
| $dispatcher | ?Milpa\Interfaces\Event\MilpaEventDispatcherInterface |
TuiComponentRenderer::supportsTarget()
public function supportsTarget(Milpa\Live\ValueObjects\RenderTarget $target): boolTrue only for {@see \Milpa\Live\ValueObjects\RenderTarget::TUI} — this renderer produces terminal lines, not markup.
Parameters
| Name | Type | Description |
|---|---|---|
| $target | Milpa\Live\ValueObjects\RenderTarget |
TuiComponentRenderer::render()
public function render(Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component, Milpa\Live\ValueObjects\RenderRequest $request): Milpa\Live\ValueObjects\RenderResultRenders one Live component to terminal lines, using the same component definition and state snapshot the HTML renderers consume.
Parameters
| Name | Type | Description |
|---|---|---|
| $component | Milpa\Live\Contracts\Component\ComponentDefinitionInterface | |
| $request | Milpa\Live\ValueObjects\RenderRequest |