mmk2410.org/site/controllers/blog.php

18 lines
355 B
PHP
Raw Normal View History

2024-03-17 22:34:51 +01:00
<?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)
];
};