-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
34 lines (29 loc) · 802 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
34
<?php
// Controle de fluxo da aplicação
define('CONTROL', true);
// Incluir arquivos
$routes = require_once('includes/routes.php');
require_once('includes/ApiConsumer.php');
// Definir rota
$route = $_GET['route'] ?? 'home';
if (!in_array($route, $routes)) {
$route = '404';
}
// Fluxo das rotas
switch ($route) {
case 'home':
require_once 'includes/header.php';
require_once 'app/home.php';
require_once 'includes/footer.php';
break;
case 'country':
require_once 'includes/header.php';
require_once 'app/country.php';
require_once 'includes/footer.php';
break;
case '404':
require_once 'includes/header.php';
require_once 'app/404.php';
require_once 'includes/footer.php';
break;
}