1
0
This repository has been archived on 2017-06-06. You can view files and clone it, but cannot push or open issues or pull requests.
informaticaD4P-2017/src/Application/Main.php

49 lines
1.1 KiB
PHP
Raw Normal View History

2017-02-18 18:49:26 +00:00
<?php
/**
* Informatica Eindproject D4p
* 6in3, Stedelijk Gymnasium Nijmegen
* Docent: Hans de Wolf
*
* ==================
*
* Daniel Boutros,
* Christiaan Goossens,
* Jelmer Hinssen
*/
2017-02-23 09:31:05 +00:00
namespace Inforbank\Application;
2017-02-18 18:49:26 +00:00
use \Slim\App;
2017-03-26 14:18:47 +00:00
use Inforbank\Application\Helper\Klant;
use Inforbank\Application\Helper\Rekeningen;
2017-02-18 18:49:26 +00:00
class Main
{
2017-02-18 18:49:26 +00:00
/**
* Constructor function
* @param App $app App Dependency Injection
*
* ==============
* INSTRUCTIEBLOK
* ==============
*
* Hier wordt onze applicatie gestart. De functie hieronder wordt aangeroepen bij het starten van de app. Hier kun je dus routes toevoegen.
*
*/
public function __construct(App $app)
{
$app->get('/', function ($request, $response, $args) {
2017-03-26 14:18:47 +00:00
// Ophalen klant
$klant = Klant::getCurrentUser();
$rekeningen = Rekeningen::getCurrentUserRekeningen();
2017-02-18 18:49:26 +00:00
// Render index view
2017-03-26 14:18:47 +00:00
return $this->renderer->render($response, 'index.phtml', [
'klant' => $klant,
'rekeningen' => $rekeningen
]);
})->add(new Auth\Middleware());
2017-02-18 18:49:26 +00:00
}
}