forked from CRSS/Website
feat: routing
This commit is contained in:
parent
fe34dcd5e2
commit
1fb549af61
15
index.php
15
index.php
|
@ -1,6 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
require_once '_config.php';
|
require_once '_config.php';
|
||||||
|
|
||||||
|
switch ($_SERVER['REQUEST_URI']) {
|
||||||
|
case "/":
|
||||||
echo $twig->render('index.twig', [
|
echo $twig->render('index.twig', [
|
||||||
'user' => null
|
'user' => null
|
||||||
]);
|
]);
|
||||||
|
break;
|
||||||
|
case "/nations":
|
||||||
|
echo $twig->render('nations.twig', [
|
||||||
|
'user' => null
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
http_response_code(404);
|
||||||
|
echo $twig->render('404.twig', [
|
||||||
|
'user' => null
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
}
|
24
template/404.twig
Normal file
24
template/404.twig
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{% include 'includes/head.twig' with {'pageTitle': '404'} %}
|
||||||
|
|
||||||
|
<div class="pageHero" id="hero">
|
||||||
|
<div class="blurFiler">
|
||||||
|
<div class="container">
|
||||||
|
<h1>Clyde's Real Survival SMP</h1>
|
||||||
|
|
||||||
|
<div class="serverInfo">
|
||||||
|
Online: <label>0</label> / <label>20</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include 'includes/nav.twig' with {'page': '404',} %}
|
||||||
|
|
||||||
|
<main class="pageContent" id="content">
|
||||||
|
<div class="container">
|
||||||
|
<h2>This page is non-existent!</h2>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
{% include 'includes/footer.twig' %}
|
||||||
|
{% include 'includes/foot.twig' %}
|
24
template/nations.twig
Normal file
24
template/nations.twig
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{% include 'includes/head.twig' with {'pageTitle': 'Nations'} %}
|
||||||
|
|
||||||
|
<div class="pageHero" id="hero">
|
||||||
|
<div class="blurFiler">
|
||||||
|
<div class="container">
|
||||||
|
<h1>Clyde's Real Survival SMP</h1>
|
||||||
|
|
||||||
|
<div class="serverInfo">
|
||||||
|
Online: <label>0</label> / <label>20</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include 'includes/nav.twig' with {'page': 'nations',} %}
|
||||||
|
|
||||||
|
<main class="pageContent" id="content">
|
||||||
|
<div class="container">
|
||||||
|
this is the home page
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
{% include 'includes/footer.twig' %}
|
||||||
|
{% include 'includes/foot.twig' %}
|
Loading…
Reference in a new issue