]> git.immae.eu Git - github/shaarli/Shaarli.git/blob - application/front/controllers/OpenSearchController.php
fa32c5f11094eecde632abdf1dc5087f886f371d
[github/shaarli/Shaarli.git] / application / front / controllers / OpenSearchController.php
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Shaarli\Front\Controller;
6
7 use Slim\Http\Request;
8 use Slim\Http\Response;
9
10 /**
11 * Class OpenSearchController
12 *
13 * Slim controller used to render open search template.
14 * This allows to add Shaarli as a search engine within the browser.
15 *
16 * @package front\controllers
17 */
18 class OpenSearchController extends ShaarliController
19 {
20 public function index(Request $request, Response $response): Response
21 {
22 $response = $response->withHeader('Content-Type', 'application/opensearchdescription+xml; charset=utf-8');
23
24 $this->assignView('serverurl', index_url($this->container->environment));
25
26 return $response->write($this->render('opensearch'));
27 }
28 }