mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-03 12:19:35 -05:00
Html: defer rendering of array content
This commit is contained in:
parent
94e29aec1d
commit
be5d8116ce
1 changed files with 10 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue