This commit is contained in:
User
2023-05-29 03:04:33 +03:00
commit 67221e0d93
41 changed files with 516 additions and 0 deletions

14
config/routes/main.json Normal file
View File

@@ -0,0 +1,14 @@
[
{
"key": "/",
"routes": [
{"action": "App\\Main\\Controllers\\IndexController", "method": "index", "params": ""}
]
},
{
"key": "[any]",
"routes": [
{"action": "App\\Main\\Controllers\\IndexController", "method": "emptyAction", "params": ""}
]
}
]

12
config/routes/main.yaml Normal file
View File

@@ -0,0 +1,12 @@
- key: "/"
routes:
- action: "App\\Main\\Controllers\\IndexController"
method: "index"
params: ""
# Empty
- key: "[any]"
routes:
- action: "App\\Main\\Controllers\\IndexController"
method: "emptyAction"
params: ""

View File

@@ -0,0 +1,13 @@
# Index
- key: "/"
routes:
- action: "App\\Main\\Controllers\\IndexController"
method: "index"
params: ""
# Empty
- key: "[any]"
routes:
- action: "App\\Main\\Controllers\\IndexController"
method: "emptyAction"
params: ""

View File

@@ -0,0 +1,9 @@
<?php
$routes = glob(__DIR__."/{*.yaml}", GLOB_BRACE);
$routesCollection = array_map(function ($routesFile){
return file_get_contents($routesFile).PHP_EOL;
}, $routes);
return yaml_parse(implode($routesCollection));