From 2eb5a432d2229788ce2fdb09f36c6f4bebdea813 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 7 Feb 2020 09:44:59 +0100 Subject: Initial commit --- src/Handlers/NewNote.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Handlers/NewNote.php (limited to 'src/Handlers/NewNote.php') diff --git a/src/Handlers/NewNote.php b/src/Handlers/NewNote.php new file mode 100644 index 0000000..9c60757 --- /dev/null +++ b/src/Handlers/NewNote.php @@ -0,0 +1,40 @@ +setContent($content); + $note->setTags($_POST["tag"]); + $note->save($env->db()); + + $url = $env->documentRoot() . "n/" . $note->getId(); + http_response_code(303); + header("Location: {$url}"); + echo 'Note created: '; + } + + echo $env->twig()->render("/new_note.twig", []); + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2