diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-13 21:51:07 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-13 21:51:07 +0100 |
| commit | cbaedbc5251f3b127bd81242d1344c0cd3e56e0c (patch) | |
| tree | f76273742992d8f06983fd5d6fef37efc85a2c07 /public/create | |
| parent | 2ab5661583d74b03c86bb4f437616bb634d9c4fc (diff) | |
Implemente redirects
Diffstat (limited to 'public/create')
| -rw-r--r-- | public/create/index.php | 23 |
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); |
