showArticle.php + showArticle-controller.php Implementation

This commit is contained in:
2026-05-29 11:29:52 +02:00
parent 7067303758
commit 1b68f037ae
3 changed files with 36 additions and 11 deletions
+19
View File
@@ -1 +1,20 @@
<?php
session_start();
require_once '../model/Article.php';
require_once '../model/ArticleManager.php';
if (isset($_GET["id"])){
try {
$articleManager = ArticleManager::getInstance();
$article = $articleManager->getArticle($_GET["id"]);
$title = $article->getTitle();
$content = $article->getContent();
$category = $article->getCategory();
$author = $article->getAuthor();
$tags = $article->getTags();
} catch (Exception $e){
$_SESSION["message"] = "internal_error";
echo "Fehler aufgetreten: " . $e->getMessage();
}
}
?>