4-move-modules-folder-up (#4)

Files were moved to /modules/ and tests config were changed too.
This commit is contained in:
2019-04-29 11:46:33 +00:00
committed by Gitea
parent 9afa848864
commit e945325c63
10 changed files with 24 additions and 11 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace ModuleName\Controller;
use DeltaCMS\Controller;
use DeltaCMS\Authentificator;
class ExampleController extends Controller
{
public function example()
{
return "hello " . $this->getUrlArguments()["arg"] . "!";
}
public function index()
{
return "Hellow Example Controller!";
}
public function isLoggedIn()
{
if (Authentificator::getInstance()->isLoggedIn()) {
return "test is false!";
} else {
return "test is true";
}
}
}

View File

@ -0,0 +1,24 @@
{
"routes": {
"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": {
"regex": "/[a-z]+/"
}
}
}
}
}