fipamo/brain/controller/RouteControl.inc.php

42 lines
1.1 KiB
PHP

<?php
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
include "brain/controller/IndexControl.inc.php";
include "brain/controller/DashControl.inc.php";
include "brain/controller/APIControl.inc.php";
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 {
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;
}
}
}