rvr-nextgen/src/Controller/HomeController.php

28 lines
601 B
PHP
Raw Normal View History

2023-04-08 00:42:55 +02:00
<?php namespace RVR\Controller;
use SokoWeb\Interfaces\Authorization\ISecured;
use SokoWeb\Interfaces\Request\IRequest;
use SokoWeb\Interfaces\Response\IContent;
use SokoWeb\Response\HtmlContent;
use SokoWeb\Response\JsonContent;
class HomeController implements ISecured
{
private IRequest $request;
public function __construct(IRequest $request)
{
$this->request = $request;
}
public function authorize(): bool
{
return $this->request->user() !== null;
}
public function getIndex(): IContent
{
return new HtmlContent('index');
}
}