404 + рефакторинг + докблоки и комменты

This commit is contained in:
2022-12-04 23:19:40 +08:00
parent f18fb9dd7a
commit bcadc316bc
14 changed files with 285 additions and 83 deletions

View File

@@ -1,9 +1,27 @@
<?php
declare(strict_types = 1);
declare(strict_types=1);
namespace App\Controllers;
use Exception;
use Flight;
/**
* Абстрактный контроллер для расширения
*/
abstract class Controller
{
/**
* Перебрасывает на страницу 404 при ненайденном плейлисте
*
* @param string $id
* @return void
* @throws Exception
*/
public function notFound(string $id): void
{
Flight::response()->status(404)->sendHeaders();
view('notfound', ['id' => $id]);
}
}