From e3d936b79bfe45c9dbe5ecdae467ac7ef8bf24b3 Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Wed, 15 May 2024 10:53:47 +0200
Subject: [PATCH] aggiunta strict type per evitare errori sui tipi (parte 93)

---
 src/Framework/Viewer.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/Framework/Viewer.php b/src/Framework/Viewer.php
index 998029b..7f77935 100644
--- a/src/Framework/Viewer.php
+++ b/src/Framework/Viewer.php
@@ -3,9 +3,13 @@
 namespace Framework;
 
 class Viewer {
-    public function render(string $template, array $data = []) {
+    public function render(string $template, array $data = []): string {
+        
         extract($data, EXTR_SKIP);
+        ob_start();
 
         require "views/$template";
+
+        return ob_get_clean();
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0