Files
surikov/kodorvan/surikov/system/controllers/surikov.php

73 lines
1.3 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace kodorvan\surikov\controllers;
// The project
use kodorvan\surikov\controllers\core,
kodorvan\surikov\models\account;
// Framework for PHP
use mirzaev\minimal\http\enumerations\content,
mirzaev\minimal\http\enumerations\status;
/**
* Surikov controller
*
* @package kodorvan\surikov\controllers
*
* @param array $errors Registry of errors
*
* @method null index() Surikov page
*
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class surikov extends core
{
/**
* Errors
*
* @var array $errors Registry of errors
*/
protected array $errors = [
'system' => [],
'account' => []
];
/**
* Surikov page
*
* @return null
*/
public function index(): null
{
if (str_contains($this->request->headers['accept'] ?? '', content::any->value)) {
// Request for any response
// Render page
$page = $this->view->render('pages/surikov/index.html');
// Sending response
$this->response
->start()
->clean()
->sse()
->write($page)
->validate($this->request)
?->body()
->end();
// Deinitializing rendered page
unset($page);
// Exit (success)
return null;
}
// Exit (fail)
return null;
}
}