28 lines
601 B
PHP
28 lines
601 B
PHP
|
<?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');
|
||
|
}
|
||
|
}
|