|
|
@@ -22,17 +22,19 @@ $app = AppFactory::create(); |
|
|
|
|
|
|
|
ini_set('display_errors', 'Off'); |
|
|
|
|
|
|
|
function addNavbar($response) |
|
|
|
function addNavbar() |
|
|
|
{ |
|
|
|
global $twig; |
|
|
|
|
|
|
|
$urls = [ |
|
|
|
["link" => "https://www.google.be", "name" => "Google"], |
|
|
|
["link" => "https://www.facebook.com", "name" => "Facebook"], |
|
|
|
["link" => "https://www.twitter.com", "name" => "Twitter"], |
|
|
|
["link" => "https://www.twitter.com", "name" => "Twitter"] |
|
|
|
]; |
|
|
|
$twig->addBlockVariable('navbar', ['urls' => $urls]); |
|
|
|
|
|
|
|
$err = ['type' => 'notice', 'text' => 'We did it!']; |
|
|
|
$twig->addBlockVariable('navbar', ['urls' => $urls]); |
|
|
|
$twig->addBlockVariable('messages',$err); |
|
|
|
} |
|
|
|
|
|
|
|
function addFooter($response) |
|
|
@@ -60,7 +62,7 @@ $app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
|
|
|
|
|
|
|
|
init(); |
|
|
|
|
|
|
|
addNavbar(); |
|
|
|
global $twig; |
|
|
|
$vars = [ |
|
|
|
"key" => "value", |
|
|
@@ -71,6 +73,7 @@ $app->get('/', function (Request $request, Response $response, array $args) { |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
$err = ["type" => "error", "text" => "something's wrong"]; |
|
|
|
$a = $twig->render('index.html.twig', $vars); |
|
|
|
$response->getBody()->write($a); |
|
|
|
|