diff --git a/wire/core/TemplateFile.php b/wire/core/TemplateFile.php index 7ed025b7..415cc61d 100644 --- a/wire/core/TemplateFile.php +++ b/wire/core/TemplateFile.php @@ -282,7 +282,7 @@ class TemplateFile extends WireData { /** * Render the template: execute it and return its output * - * @return string The output of the Template File + * @return string|array The output of the Template File * @throws WireException|\Exception Throws WireException if file not exist + any exceptions thrown by included file(s) * */ @@ -351,8 +351,9 @@ class TemplateFile extends WireData { if($this->trim) $out = trim($out); - if(!strlen($out) && !$this->halt && $this->returnValue && $this->returnValue !== 1) { - return $this->returnValue; + if(!strlen($out) && !$this->halt) { + if(is_array($this->returnValue)) return $this->returnValue; + if($this->returnValue && $this->returnValue !== 1) return $this->returnValue; } return $out;