TuiNodeRendererRegistry
Resolves which renderer paints a node, by asking each registered renderer whether it supports it. First match wins, so a catch-all renderer must be registered last.
TuiNodeRendererRegistry::register()
public function register(Milpa\Live\Contracts\Tui\TuiNodeRendererInterface $renderer): voidAdds a renderer to the resolution order. First registered is first asked, so a catch-all renderer must go last.
Parameters
| Name | Type | Description |
|---|---|---|
| $renderer | Milpa\Live\Contracts\Tui\TuiNodeRendererInterface |
TuiNodeRendererRegistry::resolve()
public function resolve(Milpa\Live\ValueObjects\Tui\TuiNode $node): ?Milpa\Live\Contracts\Tui\TuiNodeRendererInterfaceThe first registered renderer that supports this node, or null when none does — an unknown type resolves to nothing rather than being guessed at.
Parameters
| Name | Type | Description |
|---|---|---|
| $node | Milpa\Live\ValueObjects\Tui\TuiNode |