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

33 lines
703 B
PHP
Raw Permalink Normal View History

2024-01-11 04:35:40 +07:00
<?php
declare(strict_types=1);
2024-01-11 05:38:30 +07:00
namespace ${REPO_OWNER}\${REPO_NAME}\controllers;
2024-01-11 04:35:40 +07:00
// Files of the project
2024-01-11 05:38:30 +07:00
use ${REPO_OWNER}\${REPO_NAME}\controllers\core;
2024-01-11 04:35:40 +07:00
/**
* Index controller
*
2024-01-11 05:38:30 +07:00
* @package ${REPO_OWNER}\${REPO_NAME}\controllers
* @author ${REPO_OWNER} < mail >
2024-01-11 04:35:40 +07:00
*/
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;
}
}