Reworked routing for future usage with caching

This commit is contained in:
Florian Bouillon 2019-03-29 00:10:42 +01:00
parent 5d522a2064
commit 0bf98c2bf1
2 changed files with 32 additions and 10 deletions

View File

@ -1,19 +1,31 @@
{
"routes": {
"route_name": {
"index": {
"path": "/",
"controller": "\\Index\\Controller\\IndexController",
"function": "index"
},
"route_name2": {
"path": "/test/{slug}/",
"controller": "\\Index\\Controller\\IndexController",
"function": "test",
"css": {
"path": "/style.css",
"file": "/css/style.css",
"type": "text/css",
"headers": {
"Content-Type": "text/css"
}
},
"arg": {
"path": "/{arg}/{arg2}",
"controller": "\\ModuleName\\Controller\\ExampleController",
"function": "example",
"args": {
"slug": {
"arg": {
"regex": "/[a-z]+/"
},
"arg2": {
"option": "test.option"
}
}
}
}
},
"templateFolder": "/Templates/"
}

View File

@ -1,8 +1,18 @@
{
"routes": {
"route_name": {
"path": "/example/test-{arg}",
"controller": "\\AdminPanel\\Modules\\ModuleName\\Controller\\ExampleController",
"example_route": {
"path": "/example",
"controller": "\\ModuleName\\Controller\\ExampleController",
"function": "index"
},
"loggedIn": {
"path":"/example/is-logged",
"controller":"\\ModuleName\\Controller\\ExampleController",
"function": "isLoggedIn"
},
"example_route_with_arg": {
"path": "/example/{arg}",
"controller": "\\ModuleName\\Controller\\ExampleController",
"function": "example",
"args": {
"arg": {