You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Application-Web/index.php

24 lines
482 B

<?php
global $router;
require "./vendor/autoload.php";
use App\Controller\HelloPageController;
// routes initialization
$router = new AltoRouter();
// hello page controllers
$helloController = new HelloPageController();
$router->map("GET", "/", fn() => $helloController->display());
$match = $router->match();
if (!$match) {
$error = "error404";
require_once 'src/View/error.php';
header('HTTP/1.1 404 Not Found');
exit(1);
}
call_user_func($match['target']);