forked from Adleraci/adlerka.top
test
This commit is contained in:
parent
72bd8b8bd1
commit
6c1f6b1571
@ -18,7 +18,7 @@ function getEndpoint($endpoint_name): string
|
|||||||
global $routerRequest;
|
global $routerRequest;
|
||||||
|
|
||||||
if(!$endpoint_name){
|
if(!$endpoint_name){
|
||||||
$endpoint_name = $routerRequest["page_name"];
|
$endpoint_name = $routerRequest["site_name"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$endpoint_file = $routerConfig["endpoint_dir"] . $endpoint_name . ".php";
|
$endpoint_file = $routerConfig["endpoint_dir"] . $endpoint_name . ".php";
|
||||||
@ -27,7 +27,7 @@ function getEndpoint($endpoint_name): string
|
|||||||
$output = runEndpoint($endpoint_file);
|
$output = runEndpoint($endpoint_file);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$output["error"] = "Not found";
|
$output["Error"] = "Not found";
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ function initRouter(): array
|
|||||||
$request_uri = explode("/", $_SERVER["QUERY_STRING"]);
|
$request_uri = explode("/", $_SERVER["QUERY_STRING"]);
|
||||||
|
|
||||||
$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]);
|
||||||
|
Loading…
Reference in New Issue
Block a user