summaryrefslogtreecommitdiff
path: root/app.php
blob: cde972d2d315d55dde266fe4475625de9f5390a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);

define('ROOT_DIR', __DIR__ . '/../');
define('HTML_DIR', __DIR__ . '/../html/');
define('PHP_DIR',  __DIR__ . '/../php/');

require_once PHP_DIR . 'templates.php';

$file = $_GET['file'] ?? 'index.html';

$components = [
    '{{HEADER}}'  => HTML_DIR . 'header.html',
    '{{CONTENT}}' => ROOT_DIR . $file,
    '{{FOOTER}}'  => PHP_DIR  . 'footer.php'
];

$app_html = template_process(HTML_DIR . 'app.html', $components);

echo $app_html;
?>