2023-02-27 07:34:39 +00:00
|
|
|
<?php
|
2023-02-27 08:11:24 +00:00
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
require __DIR__ . '/vendor/autoload.php';
|
2023-02-27 07:34:39 +00:00
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
use Twig\Environment;
|
|
|
|
use Twig\Loader\FilesystemLoader;
|
|
|
|
|
|
|
|
$pageloader = new FilesystemLoader(__DIR__ . '/pages');
|
|
|
|
$templateloader = new FilesystemLoader(__DIR__ . '/templates');
|
|
|
|
$twig_pages = new Environment($pageloader);
|
|
|
|
$twig_templates = new Environment($templateloader);
|
|
|
|
|
|
|
|
$title = '';
|
|
|
|
$content = '';
|
|
|
|
$csspath = '';
|
|
|
|
|
|
|
|
$topictreff = $twig_templates->render('topictreff.html.twig');
|
|
|
|
$nextevents = $twig_templates->render('nextevents.html.twig');
|
|
|
|
|
|
|
|
$raumstatus = 'unbekannt';
|
|
|
|
|
|
|
|
if(isset($_GET['page'])) {
|
|
|
|
$page = $_GET['page'];
|
|
|
|
switch ($page) {
|
|
|
|
case 'index':
|
|
|
|
$title = 'index';
|
|
|
|
$content = $twig_pages->render('index.html.twig', ['raumstatus' => 'unbekannt']);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$content = $twig_pages->render('404.html.twig', ['page' => $_GET['page']]);
|
|
|
|
break;
|
2023-02-27 07:34:39 +00:00
|
|
|
}
|
2023-04-13 16:44:38 +00:00
|
|
|
} else {
|
|
|
|
$title = 'index';
|
|
|
|
$content = $twig_pages->render('index.html.twig', ['raumstatus' => 'unbekannt']);
|
|
|
|
}
|
|
|
|
|
|
|
|
$twig_templates->render('top.html.twig', ['title' => $title, 'csspath' => $csspath]);
|
|
|
|
|
|
|
|
echo $content;
|
|
|
|
|
|
|
|
$twig_templates->render('bottom.html.twig');
|
|
|
|
|
|
|
|
?>
|