Update createArticle-controller.php
This commit is contained in:
@@ -1,9 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once $abs_path . '/php/model/ArticleManager.php';
|
||||||
|
require_once $abs_path . '/php/model/Article.php';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$articleManager = new ArticleManager();
|
||||||
|
}catch (Exception $e){
|
||||||
|
die("Fehler bei der Initialisierung des Artikel-Managers: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$author = "max.mustermann@web.de"; // wird später aus session bezogen.
|
$author = "max.mustermann@web.de"; // wird später aus session bezogen.
|
||||||
$articleManager->newArticle($_POST['post-title'], $_POST['post-content'], $author);
|
$articleManager->newArticle($_POST['post-title'], $_POST['post-content'], $author);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo "Fehler beim Erstellen des Artikels: " . $e->getMessage();
|
echo "Fehler beim Erstellen des Beitrags: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user