commit | author | age | ||
157da9 | 1 | <?php |
F | 2 | |
3 | namespace Framework; | |
4 | ||
5 | class Viewer { | |
bf18c7 | 6 | public function render(string $template, array $data = []): string { |
F | 7 | |
6a2226 | 8 | extract($data, EXTR_SKIP); |
bf18c7 | 9 | ob_start(); |
6a2226 | 10 | |
ab9633 | 11 | require dirname(__DIR__, 2) . "/views/$template"; |
bf18c7 | 12 | |
F | 13 | return ob_get_clean(); |
6f9729 | 14 | } |
157da9 | 15 | } |