diff options
Diffstat (limited to 'public/create/index.php')
| -rw-r--r-- | public/create/index.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/public/create/index.php b/public/create/index.php index 00ce794..786b8f2 100644 --- a/public/create/index.php +++ b/public/create/index.php @@ -3,21 +3,31 @@ declare(strict_types=1); use DTS\Bookmark; +use DTS\Errors; +use DTS\Session; use DTS\Template; + use function DTS\Functions\respondAndExit; require_once(__DIR__.'/../../autoload.php'); $config = require_once(__DIR__.'/../../config.php'); +$session = Session::getInstance(); + if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== 'GET') { respondAndExit(405, 'Method Not Allowed'); } +$errors = $session->get('errors', new Errors()); + $template = new Template($config['path_to_templates']); $bookmark = new Bookmark(); -$html = $template->render('create', compact('bookmark')); +$html = $template->render('create', compact( + 'bookmark', + 'errors' +)); respondAndExit(200, 'OK', $html); |
