Skip to content

Commit

Permalink
fix: allow htmlElement in templates als array
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatthes committed Oct 26, 2018
1 parent 709364a commit 972572a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Fhtml/_FHtmlTemplateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -62,4 +66,4 @@ public function tpl(array $input) : self
$this->_addStructRecursive($input, $this);
return $this;
}
}
}

0 comments on commit 972572a

Please sign in to comment.