|
|
@ -26,7 +26,6 @@ class FrontController{
|
|
|
|
|
|
|
|
|
|
|
|
public function run() {
|
|
|
|
public function run() {
|
|
|
|
$this->route();
|
|
|
|
$this->route();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function route()
|
|
|
|
public function route()
|
|
|
@ -49,10 +48,10 @@ class FrontController{
|
|
|
|
ErrorController::displayFailures([ValidationFail::notFound("Cette page n'existe pas")], $twig);
|
|
|
|
ErrorController::displayFailures([ValidationFail::notFound("Cette page n'existe pas")], $twig);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->routeByResponseType($match);
|
|
|
|
$this->handleByResponseType($match);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function routeByResponseType(array $match)
|
|
|
|
private function handleByResponseType(array $match)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$response = call_user_func_array($match['target'], $match['params']);
|
|
|
|
$response = call_user_func_array($match['target'], $match['params']);
|
|
|
|
http_response_code($response->getCode());
|
|
|
|
http_response_code($response->getCode());
|
|
|
|