шаг 4 завершен

This commit is contained in:
Alisa
2026-06-04 01:30:45 +03:00
parent 62ce8c4d01
commit 238831ad3a
26 changed files with 1703 additions and 70 deletions
+9 -1
View File
@@ -2,8 +2,16 @@
declare(strict_types=1);
use App\Controllers\CatalogController;
use App\Controllers\HomeController;
use App\Core\Router;
require_once dirname(__DIR__) . '/app/bootstrap.php';
(new HomeController())->index();
$router = new Router();
$router->get('/', static fn () => (new HomeController())->index());
$router->get('/catalog', static fn () => (new CatalogController())->index());
$router->get('/catalog/{slug}', static fn (string $slug) => (new CatalogController())->category($slug));
$router->dispatch($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);