create-Article-controller Implementation

This commit is contained in:
NOrtmann1
2026-05-26 17:43:07 +02:00
parent 5bcb64f7f8
commit 8c769ba280
3 changed files with 11 additions and 4 deletions
+8 -2
View File
@@ -1,3 +1,9 @@
<?php
//TODO: implement this.
$db::newArticle($_POST['title'], $_POST['content'], $_POST['author']);
try {
$db = Database::getInstance();
$author = "max.mustermann@web.de"; // wird später aus session bezogen.
$db->newArticle($_POST['post-title'], $_POST['post-content'], $author);
} catch (PDOException $e) {
//TODO: Exception werfen, wenn das Erstellen des neuen Artikels nicht geklappt hat.
}