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

23 lines
489 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 == null) {
// TODO redirect to a 404 not found page instead (issue #1)
header('HTTP/1.1 404 Not Found');
exit(1);
}
call_user_func($match['target']);