@@ -58,8 +58,11 @@ $app->get('/', function (Request $request, Response $response, array $args) { | |||
$app->get('/blog/{slug}', function (Request $request, Response $response, array $args) { | |||
addNavbar($response); | |||
$title = $args['slug']; | |||
$response->getBody()->write("<h1>$title</h1>"); | |||
foreach ($_SESSION['blogs'] as $art) { | |||
if ($art['slug'] == $args['slug']) { | |||
$response->getBody()->write("<h1>" . $art['title'] . "</h1>"); | |||
} | |||
} | |||
addFooter($response); | |||
return $response; |