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
+33
View File
@@ -0,0 +1,33 @@
<?php
include_once "php/controller/showCategory-controller.php";
?>
<main>
<h1><?php if (isset($category) && !empty($category)){ echo htmlspecialchars($category); } ?></h1>
<div class="s-res-list">
<?php
if (!empty($articles)): ?>
<?php foreach ($articles as $article): ?>
<div class="s-res-item">
<div class="s-res-content">
<h2 class="s-res-item-title">
<a href="index.php?pfad=showArticle&id=<?php echo $article['id']; ?>" class="s-res-link">
<?php echo htmlspecialchars($article['title']); ?>
</a>
</h2>
<p class="s-res-author">Von: <span class="s-res-author-name"><?php echo htmlspecialchars($article['author']); ?></span></p>
</div>
<div class="s-res-arrow">&rarr;</div>
</div>
<?php endforeach; ?>
<?php
else: ?>
<p> Es sind noch keine Beiträge in dieser Kategorie enthalten.</p>
<?php endif; ?>
</div>
</main>