27 lines
639 B
PHP
27 lines
639 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
class DashboardController extends BaseController
|
|
{
|
|
public function beforeRoute(): void
|
|
{
|
|
$this->requireAuth();
|
|
}
|
|
|
|
public function index(): void
|
|
{
|
|
$page = max(1, (int) ($this->f3->get('GET.page') ?? 1));
|
|
$media = new Media();
|
|
$result = (new Post())->paginateList($page, 24, $media);
|
|
|
|
$this->render('admin/dashboard.html', [
|
|
'pageTitle' => 'Tableau de bord',
|
|
'posts' => $result['posts'],
|
|
'pagination' => $result,
|
|
'paginationAlias' => 'dashboard',
|
|
'adminMode' => true,
|
|
]);
|
|
}
|
|
}
|