ViewMarkup
The roots of a declared view's markup, one by one — what lets the panel compile a guest's tree NODE BY NODE and contain a failure inside the node that caused it (greenhouse decisions/0211). `XhtmlComponentCompiler::compileFragment()` renders every root of a fragment in one call: one component that throws while mounting takes the whole call — and, before this, the whole page — with it. The panel splits the fragment here instead and compiles each root on its own, so a throwing component costs its own region and nothing else. Splitting is the same XML parse the compiler does (the `milpa:` prefix bound to the same namespace), and each root is serialized back to markup the compiler parses again: the re-declared `xmlns:milpa` is the same prefix bound to the same URI, which XML allows. Containment is per ROOT of the declared view. A component nested INSIDE another root fails with that root — the compiler renders children before their parent and this package cannot catch inside it — so a view that wants a surface contained on its own declares it as a root of its tree, not as a child.
ViewMarkup::roots()
public static function roots(string $markup): arrayThe roots of `$markup`, in document order.
Parameters
| Name | Type | Description |
|---|---|---|
| $markup | string |
Throws
\RuntimeException when the markup does not parse, or carries no element at its root