<?php
require_once '../init.php';

/**
 * Router File Includieren
 */

require_once  ROOTDIR . DS . APP ."/Config/Router.php";

$match = $router->match();
if(!$auth->isLogin()) {
    $tpl->display('auth/login.tpl');
    return;
}
if ($match === false) {

    $breadcrumb = new \SCF\Core\Breadcrumb();

    $breadcrumb->setPageHeader(['404 - Seite nicht gefunden', '']);
    $crumb = [
        '' => '404 - Seite nicht gefunden'
    ];
    $breadcrumb->setBreadcrumb($crumb);

    $tpl->assign('pageHeader', $breadcrumb->getPageHeader());
    $tpl->assign('crumb', $breadcrumb->getBreadcrumb());
    $tpl->display('errorpages/404.tpl');
} else {

    try {
        require $match['target'];

    } catch(Exception $e) {
        return var_dump($e->getMessage());
    }
}

