шаг 1 сделан

This commit is contained in:
Alisa
2026-06-03 23:12:10 +03:00
parent 891315780f
commit 6d7ef09c5b
21 changed files with 658 additions and 34 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace App\Core;
final class View
{
public static function render(string $template, array $data = []): void
{
$templatePath = base_path('views/' . trim($template, '/') . '.php');
if (!is_file($templatePath)) {
http_response_code(500);
echo 'Template not found';
return;
}
extract($data, EXTR_SKIP);
require base_path('views/layouts/main.php');
}
}