Kategorien nicht statisch sondern dynamisch

This commit is contained in:
2026-06-03 19:29:29 +02:00
parent 9c3ebc9877
commit e772a8b57f
6 changed files with 138 additions and 52 deletions
@@ -0,0 +1,20 @@
<?php
require_once '../model/LocalArticleManager.php';
require_once '../model/ArticleManager.php';
if (isset($_GET["category"]) && !empty($_GET["category"]) && articleCategoryValidator($_GET["category"])){
$category = $_GET["category"];
try {
$articleManager = ArticleManager::getInstance();
$articles = $articleManager->getArticlesByCategory($category);
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
header("location: ../../index.php");
exit();
}
}else{
$_SESSION["message"] = "invalid_category";
header("location: ../../index.php");
exit();
}
?>