mirror of
https://github.com/openvk/openvk
synced 2024-12-25 10:01:05 +03:00
23 lines
552 B
PHP
23 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"),
|
|
]);
|
|
}
|
|
}
|
|
}
|