forked from projects/fipamo
63eaba08e2
I needed some consistent php formatting, so I plugged in a php fixer config and then reformatted all PHP files so it's all consistent. Fixed an ID issue with the page-edit template that was causing page editing to fail.
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace brain\controller;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
|
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;
|
|
case 'api':
|
|
return APIControl::get($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':
|
|
//$result = APIControl::post($request, $response, $args);
|
|
//var_dump($result);
|
|
return APIControl::post($request, $response, $args);
|
|
break;
|
|
default:
|
|
//echo "YES";
|
|
//return IndexControl::start($request, $response, $args);
|
|
break;
|
|
}
|
|
}
|
|
}
|