This commit is contained in:
Bruno Rybársky 2024-02-06 16:34:53 +01:00
parent ef11821f45
commit 28f7af8536
2 changed files with 3 additions and 4 deletions

@ -18,8 +18,10 @@ if (!isLoggedIn()) {
setDefaultSessionData(); setDefaultSessionData();
} }
print_r($routerRequest);
if ($routerRequest["type"] == "api") { if ($routerRequest["type"] == "api") {
echo getEndpoint($routerRequest["page_name"]); echo getEndpoint($routerRequest["site_name"]);
} elseif ($routerRequest["type"] == "page") { } elseif ($routerRequest["type"] == "page") {
echo getPage($routerRequest["site_name"], $routerRequest["page_name"]); echo getPage($routerRequest["site_name"], $routerRequest["page_name"]);

@ -10,10 +10,7 @@ function initRouter(): array
$request_uri = explode("/", $_SERVER["QUERY_STRING"]); $request_uri = explode("/", $_SERVER["QUERY_STRING"]);
echo $_SERVER["QUERY_STRING"];
print_r($request_uri);
$request_uri = array_slice($request_uri, -3, 3); $request_uri = array_slice($request_uri, -3, 3);
print_r($request_uri);
$routerRequest["site_name"] = basename($request_uri[1]); $routerRequest["site_name"] = basename($request_uri[1]);
$routerRequest["page_name"] = basename($request_uri[2]); $routerRequest["page_name"] = basename($request_uri[2]);