mirror of
https://github.com/openvk/openvk
synced 2024-11-14 19:19:14 +03:00
24 lines
552 B
PHP
24 lines
552 B
PHP
|
<?php declare(strict_types=1);
|
||
|
namespace openvk\Web\Presenters;
|
||
|
use openvk\Web\Models\Repositories\ContentSearchRepository;
|
||
|
|
||
|
final class ContentSearchPresenter extends OpenVKPresenter
|
||
|
{
|
||
|
private $repo;
|
||
|
|
||
|
function __construct(ContentSearchRepository $repo)
|
||
|
{
|
||
|
$this->repo = $repo;
|
||
|
}
|
||
|
|
||
|
function renderIndex(): void
|
||
|
{
|
||
|
if($_SERVER["REQUEST_METHOD"] === "POST")
|
||
|
{
|
||
|
$this->template->results = $repo->find([
|
||
|
"query" => $this->postParam("query"),
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
}
|