Files
webprogrammierung/php/controller/showArticle-controller.php
T
2026-05-29 11:36:39 +02:00

24 lines
704 B
PHP

<?php
session_start();
require_once '../model/Article.php';
require_once '../model/ArticleManager.php';
echo "test";
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();
}
}else{
$_SESSION["message"] = "article_not_found";
echo "article_not_found";
}
?>