-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
35 lines (29 loc) · 1.07 KB
/
routes.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
require __DIR__ . "/config.php";
require "router.php";
if (!file_exists(__DIR__ . $config["smarty"]["template"] . "/{$config["theme"]}/info.php")) {
die("Can't find this theme's 'info.php'!");
}
if (!file_exists(__DIR__ . "/system/themes/{$config["theme"]}/routes.php")) {
die("Your theme doesn't have a routes-file!");
}
define("ROOT", __DIR__ . "/");
$roudir = "system/themes/{$config["theme"]}/";
require ROOT . $roudir . "info.php";
require ROOT . $roudir . "routes.php";
require ROOT . $roudir . "themes/{$theme["config"]["theme"]}/routes.php";
// die(print_r($customRoutes));
// ##################################################
// ##################################################
// ##################################################
if (!empty($customRoutes)) {
foreach ($customRoutes as $key => $route) {
if ($route[0] == "get") {
get($route[1], $roudir . $route[2]);
} elseif ($route[0] == "post") {
post($route[1], $roudir . $route[2]);
} else {
any($route[1], $roudir . $route[2]);
}
}
}