ComponentRendererRegistryInterface
Resolves a {@see ComponentRendererInterface} by render target, mirroring the {@see \Milpa\Live\Contracts\Tui\TuiNodeRendererRegistryInterface} pattern (register + supports-based resolve) on the component-renderer side of the render seam.
ComponentRendererRegistryInterface::register()
abstract public function register(Milpa\Live\Contracts\Rendering\ComponentRendererInterface $renderer): voidRegisters a renderer. Implementations that keep an ordered list and resolve by first match SHOULD prefer the most recently registered renderer when more than one claims to {@see ComponentRendererInterface::supportsTarget()} the same target.
Parameters
| Name | Type | Description |
|---|---|---|
| $renderer | Milpa\Live\Contracts\Rendering\ComponentRendererInterface |
ComponentRendererRegistryInterface::resolve()
abstract public function resolve(Milpa\Live\ValueObjects\RenderTarget $target): ?Milpa\Live\Contracts\Rendering\ComponentRendererInterfaceLooks up the renderer that {@see ComponentRendererInterface::supportsTarget()} the given target.
Parameters
| Name | Type | Description |
|---|---|---|
| $target | Milpa\Live\ValueObjects\RenderTarget |
Returns
`null` if no registered renderer supports this target — callers decide whether that is fatal.