-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (31 loc) · 941 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require_once __DIR__ . "/autoload.php";
use Maker\Router\Router;
if (Router::get(2) == "actions") {
require_once __DIR__ . "/src/actions/create.php";
die();
}
if (!Router::get(2)) {
$file = "start";
} else {
$file = Router::get(2);
}
?>
<!doctype html>
<html>
<head>
<title>Create your webpage for free! Challenge - 16</title>
<?php require_once __DIR__ . "/src/components/meta.php"; ?>
<?php require_once __DIR__ . "/src/components/links.php"; ?>
</head>
<body>
<?php
if (file_exists(__DIR__ . "/src/templates/{$file}" . ".php")) {
require_once __DIR__ . "/src/templates/{$file}" . ".php";
} else {
require_once __DIR__ . "/src/templates/404.php";
}
?>
<?php require_once __DIR__ . "/src/components/scripts.php"; ?>
</body>
</html>