-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
40 lines (32 loc) · 1.12 KB
/
index.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
36
37
38
39
40
<?php require_once('app/core.php'); ?>
<?php
// Check against endpoints & Get Current Page View
$server_endpoints = [
'/'=>[
'view' => "home",
'data_method' => "get_home",
],
'/show'=> [
'view' => "show",
'data_method' => "check_next",
],
];
if(!in_array(URI::first(), array_keys($server_endpoints))) exit_with_error(404);
$current_page = $server_endpoints[URI::first()]['view'];
$current_data_get_function = $server_endpoints[URI::first()]['data_method'];
// pretty_print( "Url Root: " . URI::first());
// pretty_print( "Layout: " . $current_page);
// pretty_print(PARSER::emmet_to_html('.test*4'));
// pretty_print(PARSER::emmet_to_html('.test>.time*4'));
// pretty_print(PARSER::emmet_to_html('.test*4>.x'));
// dd(PARSER::emmet_to_html('.test>.time+.time'));
// render view with data or throw 404 if that fails
try {
$current_data = call_user_func(['PageController', $current_data_get_function]);
// pretty_print($current_data);
invoke("pages/{$current_page}.php", $current_data);
} catch (\Throwable $th) {
if(FIVE_ACE) pretty_print($th);
exit_with_error(404);
}
?>