|
|
@@ -32,6 +32,8 @@ function addNavbar() |
|
|
|
["link" => "https://www.facebook.com", "name" => "Facebook"], |
|
|
|
["link" => "https://www.twiter.com", "name" => "Twitter"] |
|
|
|
]; |
|
|
|
$err = ['type' => 'notice', 'text' => "we did it!"]; |
|
|
|
$twig->addMessage($err); |
|
|
|
$twig->addBlockVariable('navbar', ['urls' => $urls]); |
|
|
|
} |
|
|
|
|
|
|
@@ -58,15 +60,12 @@ $app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
} |
|
|
|
|
|
|
|
$vars = [ |
|
|
|
"key" => "value", |
|
|
|
'key2' => ["val1", "val2", "val3"], |
|
|
|
"key3" => ["x1" => "y1", "x2" => "y2"], |
|
|
|
"loggedIn" => isset($_SESSION['username']), |
|
|
|
"content" => "Dit is de main body met info" |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
global $twig; |
|
|
|
$err = ['type' => 'error', 'text' => "something's wrong"]; |
|
|
|
$twig->addMessage($err); |
|
|
|
$a = $twig->render('index.html.twig', $vars); |
|
|
|
$response->getBody()->write($a); |
|
|
|
return $response; |