aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controller/visitor/OpenSearchController.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-05-22 13:20:31 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit2899ebb5b5e82890c877151f5c02045266ac9973 (patch)
tree0c4e2684c7f6d161f92a21181bfa4b2f78d6a82f /application/front/controller/visitor/OpenSearchController.php
parentaf290059d10319e76d1e7d78b592cab99c26d91a (diff)
downloadShaarli-2899ebb5b5e82890c877151f5c02045266ac9973.tar.gz
Shaarli-2899ebb5b5e82890c877151f5c02045266ac9973.tar.zst
Shaarli-2899ebb5b5e82890c877151f5c02045266ac9973.zip
Initialize admin Slim controllers
- Reorganize visitor controllers - Fix redirection with Slim's requests base path - Fix daily links
Diffstat (limited to 'application/front/controller/visitor/OpenSearchController.php')
-rw-r--r--application/front/controller/visitor/OpenSearchController.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/application/front/controller/visitor/OpenSearchController.php b/application/front/controller/visitor/OpenSearchController.php
new file mode 100644
index 00000000..0fd68db6
--- /dev/null
+++ b/application/front/controller/visitor/OpenSearchController.php
@@ -0,0 +1,26 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Shaarli\Front\Controller\Visitor;
6
7use Slim\Http\Request;
8use 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 */
16class OpenSearchController extends ShaarliVisitorController
17{
18 public function index(Request $request, Response $response): Response
19 {
20 $response = $response->withHeader('Content-Type', 'application/opensearchdescription+xml; charset=utf-8');
21
22 $this->assignView('serverurl', index_url($this->container->environment));
23
24 return $response->write($this->render('opensearch'));
25 }
26}