MarkupCompilerInterface
Compiles authored XHTML-with-component-tags markup (e.g. `<milpa:autocomplete .../>`) into a single rendered {@see RenderResult} by resolving each component tag through a {@see \Milpa\Live\Contracts\Component\ComponentRegistryInterface} and its paired {@see ComponentRendererInterface}. This is the authoring-time seam: templates write component tags, not renderer calls.
MarkupCompilerInterface::compile()
abstract public function compile(string $markup, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\RenderResultCompiles markup that MUST contain exactly one root component element into that component's rendered output.
Parameters
| Name | Type | Description |
|---|---|---|
| $markup | string | |
| $context | Milpa\Live\ValueObjects\ComponentContext |
Throws
\RuntimeException If the markup is not valid XML, does not contain exactly one root
component element, or names a component/renderer that is not
registered.