From 972572a1d8cfd12d31b3b6ff1c4b42b69f28fa49 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 26 Oct 2018 15:07:01 +0200 Subject: [PATCH] fix: allow htmlElement in templates als array --- src/Fhtml/_FHtmlTemplateTrait.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Fhtml/_FHtmlTemplateTrait.php b/src/Fhtml/_FHtmlTemplateTrait.php index 53dfa6d..47b7e0b 100644 --- a/src/Fhtml/_FHtmlTemplateTrait.php +++ b/src/Fhtml/_FHtmlTemplateTrait.php @@ -26,7 +26,7 @@ trait _FHtmlTemplateTrait private function _addStructRecursive ($node, FHtml $pointer) : void { - if ($node instanceof RawHtmlNode) { + if ($node instanceof HtmlElementNode) { $pointer->curNode->add($node); return; } @@ -49,10 +49,14 @@ private function _addStructRecursive ($node, FHtml $pointer) : void $this->_addStructRecursive($value, $pointer->elem($key)); //if ($pointer->curNode !== $pointer->documentNode) // $pointer->end(); + continue; } if (is_int($key)) { $this->_addStructRecursive($value, $pointer); + continue; } + if ($value instanceof HtmlElementNode) + $pointer->curNode->add($value); } return; } @@ -62,4 +66,4 @@ public function tpl(array $input) : self $this->_addStructRecursive($input, $this); return $this; } -} \ No newline at end of file +}