From be5d8116ce81c0404ad1ef51671d5bb598660cae Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 27 Feb 2017 12:28:40 +0100 Subject: [PATCH] Html: defer rendering of array content --- library/Businessprocess/Html/Html.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/Businessprocess/Html/Html.php b/library/Businessprocess/Html/Html.php index 6a44beb..200da14 100644 --- a/library/Businessprocess/Html/Html.php +++ b/library/Businessprocess/Html/Html.php @@ -44,9 +44,8 @@ class Html implements Renderable */ public function setContent($content) { - $this->content = array( - static::escape($content) - ); + $this->content = array(); + static::addContent($content); return $this; } @@ -57,7 +56,14 @@ class Html implements Renderable */ public function addContent($content) { - $this->content[] = static::escape($content); + if (is_array($content)) { + foreach ($content as $c) { + static::addContent($c); + } + } else { + $this->content[] = static::escape($content); + } + return $this; }