Commit 2d411bc9 authored by Moreau Elise's avatar Moreau Elise
Browse files

add session in routes

parent d263359c
......@@ -58,12 +58,12 @@ return function (App $app) {
});
$app->get('/', function (Request $request, Response $response) {
return $this->get(Twig::class)->render($response, "/home/home.twig", []);
return $this->get(Twig::class)->render($response, "/home/home.twig", ["session" => $_SESSION]);
}
);
$app->get('/signup', function (Request $request, Response $response) {
return $this->get(Twig::class)->render($response, "/user/create_user.twig", []);
return $this->get(Twig::class)->render($response, "/user/create_user.twig", ["session" => $_SESSION]);
}
);
......@@ -71,7 +71,7 @@ return function (App $app) {
$app->group('/search', function (Group $group) {
$group->get('', function (Request $request, Response $response) {
return $this->get(Twig::class)->render($response, "/home/search.twig", []);
return $this->get(Twig::class)->render($response, "/home/search.twig", ["session" => $_SESSION]);
});
$group->post('', SearchAction::class);
}
......@@ -120,7 +120,7 @@ return function (App $app) {
$app->group(
'/groups', function (Group $group) {
$group->get('/create', function (Request $request, Response $response) {
return $this->get(Twig::class)->render($response, "/group/create_group.twig", []);
return $this->get(Twig::class)->render($response, "/group/create_group.twig", ["session" => $_SESSION]);
});
$group->get('', ListGroupsAction::class);
$group->get('/{id}', ViewGroupAction::class);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment