First Commit
This commit is contained in:
commit
923d6ca242
35 changed files with 4933 additions and 0 deletions
20
src/php/Routing/ErrorRoute.php
Normal file
20
src/php/Routing/ErrorRoute.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace GamesShop\Routing;
|
||||
|
||||
use GamesShop\ContainerHandler;
|
||||
use GamesShop\Templates\TemplateEngine;
|
||||
use Laminas\Diactoros\Response;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
final class ErrorRoute
|
||||
{
|
||||
public function renderErrorPage(int $errorCode): ResponseInterface {
|
||||
$pageContent = ContainerHandler::get(TemplateEngine::class)->renderPage('error', [ 'errorCode' => $errorCode ]);
|
||||
|
||||
$response = new Response;
|
||||
$response->getBody()->write($pageContent);
|
||||
return $response;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue