Fix rendering of arrays

This commit is contained in:
2023-01-27 15:34:41 +01:00
parent 3dab3e6ffb
commit d026dfa72b

View File

@@ -79,6 +79,18 @@ function EnsureDirectoryOrDie($dir) {
}
}
function RenderElement($element) {
if (is_array($element)) {
$html = '';
foreach ($element as $child) {
$html .= RenderElement($child);
}
return $html;
}
return $element->render();
}
function RenderResponseToHTML($response) {
$html = '';
@@ -88,7 +100,7 @@ function RenderResponseToHTML($response) {
}
foreach ($response->renderChildren() as $child) {
$html .= $child->render();
$html .= RenderElement($child);
}
return $html;