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();
| }
| }
|
|