summaryrefslogtreecommitdiff
path: root/public/create/index.php
diff options
context:
space:
mode:
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);