2021-03-27 04:24:16 +01:00
|
|
|
<?php
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
|
|
2021-03-29 00:22:00 +02:00
|
|
|
include "../brain/controller/IndexControl.inc.php";
|
|
|
|
include "../brain/controller/DashControl.inc.php";
|
|
|
|
include "../brain/controller/APIControl.inc.php";
|
2021-03-27 04:24:16 +01:00
|
|
|
|
|
|
|
class RouteControl
|
|
|
|
{
|
|
|
|
public function get(
|
|
|
|
ServerRequestInterface $request,
|
|
|
|
ResponseInterface $response,
|
|
|
|
array $args
|
|
|
|
): ResponseInterface {
|
|
|
|
switch (isset($args["first"]) ? $args["first"] : "index") {
|
|
|
|
case "dashboard":
|
|
|
|
return DashControl::start($request, $response, $args);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return IndexControl::start($request, $response, $args);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function post(
|
|
|
|
ServerRequestInterface $request,
|
|
|
|
ResponseInterface $response,
|
|
|
|
array $args
|
|
|
|
): ResponseInterface {
|
2021-03-27 21:59:44 +01:00
|
|
|
switch (isset($args["first"]) ? $args["first"] : "index") {
|
|
|
|
case "api":
|
|
|
|
return APIControl::start($request, $response, $args);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
//echo "YES";
|
|
|
|
//return IndexControl::start($request, $response, $args);
|
|
|
|
break;
|
|
|
|
}
|
2021-03-27 04:24:16 +01:00
|
|
|
}
|
|
|
|
}
|