Files
oficial/app/src/Controller/Base.php
2023-10-11 09:03:44 -03:00

34 lines
1.0 KiB
PHP

<?php
namespace Incoviba\Controller;
use DateTimeImmutable;
use DateInterval;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Incoviba\Common\Alias\View;
use Incoviba\Service;
use Incoviba\Repository;
class Base
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Login $service): ResponseInterface
{
if ($service->isIn()) {
return $this->home($response, $view);
}
return $this->login($response, $view);
}
public function construccion(ServerRequestInterface $request, ResponseInterface $response, View $view): ResponseInterface
{
return $view->render($response, 'construccion');
}
protected function home(ResponseInterface $response, View $view): ResponseInterface
{
return $view->render($response, 'home');
}
protected function login(ResponseInterface $response, View $view): ResponseInterface
{
return $view->render($response, 'guest');
}
}