-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (26 loc) · 778 Bytes
/
index.php
File metadata and controls
32 lines (26 loc) · 778 Bytes
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
<?php
require_once 'autoload.php';
require_once 'config/db.php';
require_once 'config/parametros.php';
require_once 'helpers/utils.php';
require_once 'views/layout/header.php';
require_once 'views/layout/sidebar.php';
$db = Database::connect();
if (isset($_GET['controller'])) {
$nombre_controlador = $_GET['controller'].'Controller';
} else {
echo 'La página no existe';
exit();
}
if (class_exists($nombre_controlador)) {
$controlador = new $nombre_controlador();
if (isset($_GET['action']) && method_exists($controlador, $_GET['action'])) {
$action = $_GET['action'];
$controlador->$action();
} else {
echo 'La página no existe';
}
} else {
echo 'La página no existe';
}
require_once 'views/layout/footer.php';