3 declare(strict_types
=1);
5 namespace Shaarli\Front\Controller\Visitor
;
7 use Shaarli\Render\TemplatePage
;
9 use Slim\Http\Response
;
12 * Class OpenSearchController
14 * Slim controller used to render open search template.
15 * This allows to add Shaarli as a search engine within the browser.
17 class OpenSearchController
extends ShaarliVisitorController
19 public function index(Request
$request, Response
$response): Response
21 $response = $response->withHeader('Content-Type', 'application/opensearchdescription+xml; charset=utf-8');
23 $this->assignView('serverurl', index_url($this->container
->environment
));
25 return $response->write($this->render(TemplatePage
::OPEN_SEARCH
));