-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
53 lines (41 loc) · 1.27 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
require_once("libs/utilities.php");
$pageRequest = "home";
$modo = "INS";
if(isset($_GET["page"])){
$pageRequest = $_GET["page"];
}
if(isset($_GET["modo"])){
$modo =$_GET["modo"];
}
//Incorporando los midlewares son codigos que se deben ejecutar
//Siempre
require_once("controllers/site.mw.php");
require_once("controllers/verificar.mw.php");
//Este switch se encarga de todo el enrutamiento
switch($pageRequest){
case "home":
//llamar al controlador
require_once("controllers/home.control.php");
break;
case "login":
require_once("controllers/login.control.php");
break;
case "registro":
require_once("controllers/registro.control.php");
break;
case "categorias":
//llamar al controlador
require_once("controllers/categorias.control.php");
break;
case "productos":
//llamar al controlador
require_once("controllers/productos.control.php");
break;
//para agregar una nueva pagina
// agregar otro case
default:
require_once("controllers/error.control.php");
}
?>