-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
27 lines (21 loc) · 702 Bytes
/
Copy pathapi.php
File metadata and controls
27 lines (21 loc) · 702 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
<?php
set_include_path(implode(PATH_SEPARATOR, array(
realpath(realpath(dirname(__FILE__)) . '/admin/libs'),
get_include_path(), //uncomment for developer environment only
)));
require_once 'admin/includes/bootstrap.php';
$controllerName = 'HandlerController';
require ROOT_DIR . 'controllers' . DIRECTORY_SEPARATOR . $controllerName . '.php';
if (!empty($_REQUEST['act'])) {
$actionName = trim($_REQUEST['act']);
} else {
$actionName = 'index';
}
$actionMethod = $actionName.'Action';
if (method_exists($controllerName, $actionMethod)) {
$controler = new $controllerName;
call_user_func(array($controler, $actionMethod));
} else {
echo 'action not found';
exit;
}