forked from bagvendt/vaip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
35 lines (26 loc) · 827 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
<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'on');
define('VIEWS', 'views');
define('CONTROLLERS', 'controllers');
define('MODELS', 'models');
require_once 'Views.php';
require_once 'Models.php';
require_once 'Controllers.php';
require_once 'Route.php';
function main() {
session_start();
$views = new Views();
$models = new Models('localhost', 'hallas', '40352246', 'thehallas');
$route = new Route($_SERVER['REQUEST_URI']);
require_once CONTROLLERS .'/'. $route->getParam(1) .'.php';
$controller = eval('return new '. $route->getParam(1) .'($views, $models, $route);');
if(!$route->getParam(2)) {
$controller->index();
} else {
eval('$controller->'. $route->getParam(2) .'();');
}
$views->render();
}
main();
?>