mirror of
https://github.com/openvk/openvk
synced 2025-03-04 08:39:50 +03:00
26 lines
574 B
PHP
26 lines
574 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace openvk\Web\Presenters;
|
|
|
|
use openvk\Web\Models\Repositories\ContentSearchRepository;
|
|
|
|
final class ContentSearchPresenter extends OpenVKPresenter
|
|
{
|
|
protected $repo;
|
|
|
|
public function __construct(ContentSearchRepository $repository)
|
|
{
|
|
$this->repo = $repository;
|
|
}
|
|
|
|
public function renderIndex(): void
|
|
{
|
|
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|
$this->template->results = $this->repo->find([
|
|
"query" => $this->postParam("query"),
|
|
]);
|
|
}
|
|
}
|
|
}
|