More robust

This commit is contained in:
julien
2026-03-27 20:14:11 +01:00
parent 75ec966435
commit 68c547ddcb
25 changed files with 474 additions and 224 deletions

View File

@@ -4,19 +4,22 @@ declare(strict_types=1);
class DashboardController extends BaseController
{
public function index(): void
public function beforeRoute(): void
{
$this->requireAuth();
$this->f3->expire(0);
$this->disableCache();
}
public function index(): void
{
$page = max(1, (int) ($this->f3->get('GET.page') ?? 1));
$result = (new Post($this->db))->paginateList($page, 24);
$this->render('admin/dashboard.html', [
$this->renderSession('admin/dashboard.html', [
'pageTitle' => 'Tableau de bord',
'posts' => $result['posts'],
'pagination' => $result,
'paginationBase' => $this->f3->alias('dashboard'),
]);
'paginationAlias' => 'dashboard',
], true);
}
}