Ajoute la gateway des commentaires et corrige les vues

This commit is contained in:
Colin FRIZOT
2022-11-30 10:33:53 +01:00
parent 45eabf2503
commit 9519287329
8 changed files with 145 additions and 1 deletions

View File

@@ -11,7 +11,9 @@ $loader->register();
$security = new \Silex\Controller\SecurityController();
$user = new \Silex\Controller\UserController();
$router = new Router($_SERVER['REQUEST_URI']);
$router->setBasePath("~cofrizot/silex/index.php");
$router->get('/^$/', [$user, 'index']);
$router->get('/^news\/(?<id>[\w-]+)$/', [$user, 'viewPost']);
$router->get('/^comments\/(?<id>[\w-]+)$/', [$user, 'viewPostComments']);
$router->match('/^login$/', [$security, 'login']);
$router->run(new \Silex\DI\DI($router))->render(__DIR__ . '/../' . VIEW_PATH);