шаг 4 завершен
This commit is contained in:
+9
-1
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user