refactoring
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
//$db = Database::getInstance();
|
||||
$db = new ArticleManager();
|
||||
$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.
|
||||
$articleManager->newArticle($_POST['post-title'], $_POST['post-content'], $author);
|
||||
} catch (Exception $e) {
|
||||
echo "Fehler beim Erstellen des Artikels: " . $e->getMessage();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user