From d5fddd303ca7de29311aee91ba78c67c6e638dcc Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 29 Aug 2025 17:09:13 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#2116 --- wire/core/TemplateFile.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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;