Skip to content

Commit 5fb1045

Browse files
authored
feat(router): support returning string and array from controllers (#1083)
1 parent 04b5bd6 commit 5fb1045

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tempest/Router/src/GenericRouter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ public function isCurrentUri(array|string $action, ...$params): bool
187187
return $currentUri === $candidateUri;
188188
}
189189

190-
private function createResponse(Response|View $input): Response
190+
private function createResponse(string|array|Response|View $input): Response
191191
{
192-
if ($input instanceof View) {
192+
if ($input instanceof View || is_array($input) || is_string($input)) {
193193
return new Ok($input);
194194
}
195195

0 commit comments

Comments
 (0)