-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
43 lines (37 loc) · 1.06 KB
/
Copy pathindex.php
File metadata and controls
43 lines (37 loc) · 1.06 KB
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
<?php
//session_start();
require_once 'core/core.php';
$c = isset($_GET['c']) ? $_GET['c'] : 'administrator';
//$c = 'administratorController';
$m = isset($_GET['m']) ? $_GET['m'] : 'index';
$c .= 'Controller';
//var_dump($m, $c);
if (file_exists('controllers/' . $c . '.php')) {
require_once 'controllers/' . $c . '.php';
if (method_exists($c, $m)) {
$c = new $c;
call_user_func([$c, $m]);
} else {
die("Error : El metodo o funcion [{$m}()] no existe");
}
} else {
die("Error : El controlador [{$c}] no existe.");
}
/*//$c = isset($_GET['c']) ? $_GET['c'] : 'administrator';
$ac = 'agentsController';
$am = isset($_GET['am']) ? $_GET['am'] : 'agents';
//$c .= 'Controller';
var_dump($am, $ac);
if (file_exists('controllers/' . $ac . '.php')) {
require_once 'controllers/' . $ac . '.php';
if (method_exists($ac, $am)) {
$ac = new $ac;
call_user_func([$ac, $am]);
} else {
die("Error : El metodo o funcion [{$am}()] no existe");
}
} else {
die("Error : El controlador [{$ac}] no existe.");
}
/*
*/