-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·40 lines (31 loc) · 997 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
35
36
37
38
39
40
<?php
//Autoloader to charge all Classes
function chargerClasse($classe){
require 'class/' . $classe . '.php';
}
spl_autoload_register('chargerClasse');
//GLOBALS VARIABLES
$Title = null; //Title of the page
$Model = null; // Model of the page => ! is required
$Ctrl = null; // Controller of the page
$View = null; // View of the page
//Requiring the route list (wich include the router function)
require 'elements/routes.php';
//Including the model which will give us The Title, The Controller and The View
include 'models/' . $Model;
//include the controller if Exists
if(!is_null($Ctrl)){
include 'controllers/' . $Ctrl;
}
/************************************************
************** DISPLAY CONTENT ******************
************************************************/
if(!is_null($View)){
//including header
include 'elements/header.php';
//including the view
include 'views/' . $View;
//including footer
include 'elements/footer.php';
}
?>