summaryrefslogtreecommitdiff
path: root/public/create/index.php
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-10-13 21:51:07 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-10-13 21:51:07 +0100
commitcbaedbc5251f3b127bd81242d1344c0cd3e56e0c (patch)
treef76273742992d8f06983fd5d6fef37efc85a2c07 /public/create/index.php
parent2ab5661583d74b03c86bb4f437616bb634d9c4fc (diff)
Implemente redirects
Diffstat (limited to 'public/create/index.php')
-rw-r--r--public/create/index.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/public/create/index.php b/public/create/index.php
new file mode 100644
index 0000000..00ce794
--- /dev/null
+++ b/public/create/index.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+use DTS\Bookmark;
+use DTS\Template;
+use function DTS\Functions\respondAndExit;
+
+require_once(__DIR__.'/../../autoload.php');
+
+$config = require_once(__DIR__.'/../../config.php');
+
+if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== 'GET') {
+ respondAndExit(405, 'Method Not Allowed');
+}
+
+$template = new Template($config['path_to_templates']);
+
+$bookmark = new Bookmark();
+
+$html = $template->render('create', compact('bookmark'));
+
+respondAndExit(200, 'OK', $html);