corso https://vola.udemy.com/course/php-mvc-from-scratch/learn/lecture/40931984#overview
filippo.bertilotti
2024-05-21 a26040f4846abcc8a8f8e81eb2d6d7923c384fdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
 
namespace Framework;
 
class Viewer {
    public function render(string $template, array $data = []): string {
        
        extract($data, EXTR_SKIP);
        ob_start();
 
        require dirname(__DIR__, 2) . "/views/$template";
 
        return ob_get_clean();
    }
}