|
|
@@ -8,18 +8,20 @@ require __DIR__ . '/../vendor/autoload.php'; |
|
|
|
$app = AppFactory::create(); |
|
|
|
|
|
|
|
function addNavbar($response) { |
|
|
|
$response->getBody()->write("<html><head></head><body>"); |
|
|
|
$response->getBody()->write("<div><a href='/'>Index</a> | <a href='/login'>login</a></div>"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
function addFooter($response) { |
|
|
|
$response->getBody()->write("<div>Privacy statement | Cookie Policy | Contact</div>"); |
|
|
|
$response->getBody()->write("</body></html>"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
$app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
|
|
|
|
$response->getBody()->write("<html><head></head><body>"); |
|
|
|
|
|
|
|
|
|
|
|
addNavbar($response); |
|
|
|
|
|
|
@@ -32,12 +34,11 @@ $app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
$response->getBody()->write("</ul>"); |
|
|
|
$response->getBody()->write("<hr/>"); |
|
|
|
addFooter($response); |
|
|
|
$response->getBody()->write("</body></html>"); |
|
|
|
|
|
|
|
return $response; |
|
|
|
}); |
|
|
|
|
|
|
|
$app->get('/blog/{slug}', function (Request $request, Response $response, array $args) { |
|
|
|
$response->getBody()->write("<html><head></head><body>"); |
|
|
|
|
|
|
|
addNavbar($response); |
|
|
|
$title = $args['slug']; |