parser_from_rossko/author/project/system/controllers/index.php

33 lines
691 B
PHP
Raw Normal View History

2024-07-15 15:20:06 +07:00
<?php
declare(strict_types=1);
namespace mirzaev\parser_from_rossko\controllers;
// Files of the project
use mirzaev\parser_from_rossko\controllers\core;
/**
* Index controller
*
* @package mirzaev\parser_from_rossko\controllers
* @author mirzaev < mail >
*/
final class index extends core
{
/**
* Render the main page
*
* @param array parameters Parameters of the request (POST + GET)
*/
public function index(array parameters = []): ?string
{
// Exit (success)
if (_SERVER['REQUEST_METHOD'] === 'GET') return this->view->render(DIRECTORY_SEPARATOR . 'index.html');
else if (_SERVER['REQUEST_METHOD'] === 'POST') return main;
// Exit (fail)
return null;
}
}