Added base routing + moved rekeningen
parent
ffe56bcf9b
commit
afc472e7d7
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Informatica Eindproject D4p
|
||||
* 6in3, Stedelijk Gymnasium Nijmegen
|
||||
* Docent: Hans de Wolf
|
||||
*
|
||||
* ==================
|
||||
*
|
||||
* Daniel Boutros,
|
||||
* Christiaan Goossens,
|
||||
* Jelmer Hinssen
|
||||
*/
|
||||
|
||||
namespace Inforbank\Application\Helper;
|
||||
|
||||
use Inforbank\Application;
|
||||
use Inforbank\Application\Helper\Klant;
|
||||
use Inforbank\Proxy;
|
||||
|
||||
class Header
|
||||
{
|
||||
public static function getHeaderData()
|
||||
{
|
||||
$klant = Klant::getCurrentUser();
|
||||
$base = Proxy::$route->getBaseUrl() . "/";
|
||||
return array(
|
||||
'klant' => $klant,
|
||||
'base' => $base
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Informatica Eindproject D4p
|
||||
* 6in3, Stedelijk Gymnasium Nijmegen
|
||||
* Docent: Hans de Wolf
|
||||
*
|
||||
* ==================
|
||||
*
|
||||
* Daniel Boutros,
|
||||
* Christiaan Goossens,
|
||||
* Jelmer Hinssen
|
||||
*/
|
||||
|
||||
namespace Inforbank\Application;
|
||||
|
||||
use \Slim\App;
|
||||
use Inforbank\Application\Helper\Header;
|
||||
use Inforbank\Application\Helper\Rekeningen as RekeningHelper;
|
||||
|
||||
class Rekeningen
|
||||
{
|
||||
public function __construct(App $app)
|
||||
{
|
||||
$app->get('/rekeningen', function ($request, $response, $args) {
|
||||
// Ophalen klant
|
||||
$rekeningen = RekeningHelper::getCurrentUserRekeningen();
|
||||
|
||||
// Render index view
|
||||
return $this->renderer->render($response, 'index.phtml', [
|
||||
'header' => Header::getHeaderData(),
|
||||
'rekeningen' => $rekeningen
|
||||
]);
|
||||
})->add(new Auth\Middleware());
|
||||
}
|
||||
}
|
Reference in New Issue