ComponentRegistryInterface
A name-keyed lookup of {@see ComponentDefinitionInterface} instances. Every render path (HTML compiler, TUI component node, HTTP live endpoint) resolves components exclusively through here — by contract name, never by class reference — so a component's implementation can be swapped without touching call sites.
ComponentRegistryInterface::has()
abstract public function has(string $name): boolWhether a component is registered under this name.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |
ComponentRegistryInterface::get()
abstract public function get(string $name): Milpa\Live\Contracts\Component\ComponentDefinitionInterfaceLooks up a registered component by name.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |
Throws
\RuntimeException If no component is registered under `$name`. Callers MUST check
{@see has()} first when a missing component is an expected,
recoverable case rather than a programming error.
ComponentRegistryInterface::register()
abstract public function register(string $name, Milpa\Live\Contracts\Component\ComponentDefinitionInterface $component): voidRegisters a component under the given name, replacing any existing registration for that name.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $component | Milpa\Live\Contracts\Component\ComponentDefinitionInterface |