From 2c1fa702aa45fd2bfa84cf5b8c587b36056fb553 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 4 Aug 2024 23:24:09 +0000 Subject: [PATCH] Fixed some templates not rendering. --- src/RoutingContext.php | 1 + src/StringableContentHandler.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/StringableContentHandler.php diff --git a/src/RoutingContext.php b/src/RoutingContext.php index a6c1c04..cd747e4 100644 --- a/src/RoutingContext.php +++ b/src/RoutingContext.php @@ -9,6 +9,7 @@ class RoutingContext { public function __construct(SeriaContext $context) { $this->router = new HttpRouter(errorHandler: new RoutingErrorHandler($context)); $this->router->use('/', fn($resp) => $resp->setPoweredBy('Seria')); + $this->router->registerContentHandler(new StringableContentHandler); // this should really be in Index lol but i can't be bothered rn! } public function getRouter(): IRouter { diff --git a/src/StringableContentHandler.php b/src/StringableContentHandler.php new file mode 100644 index 0000000..7d71e75 --- /dev/null +++ b/src/StringableContentHandler.php @@ -0,0 +1,18 @@ +setContent(new StringContent((string)$content)); + } +}