mmk2410.org/site/controllers/blog.php
2024-03-17 22:34:51 +01:00

17 lines
355 B
PHP

<?php
return function ($page, $tag, $category) {
$articles = $page->children()->listed();
if ($tag) {
$articles = $articles->filterBy('tags', $tag, ',');
}
if ($category) {
$articles = $articles->filterBy('categories', $category, ',');
}
return [
'articles' => $articles->flip()->paginate(20)
];
};