First commit
This commit is contained in:
22
app/Controllers/DashboardController.php
Normal file
22
app/Controllers/DashboardController.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
class DashboardController extends BaseController
|
||||
{
|
||||
public function index(): void
|
||||
{
|
||||
$this->requireAuth();
|
||||
$this->f3->expire(0);
|
||||
|
||||
$page = max(1, (int) ($this->f3->get('GET.page') ?? 1));
|
||||
$result = (new Post($this->db))->paginateList($page, 24);
|
||||
|
||||
$this->render('admin/dashboard.html', [
|
||||
'pageTitle' => 'Tableau de bord',
|
||||
'posts' => $result['posts'],
|
||||
'pagination' => $result,
|
||||
'paginationBase' => $this->f3->alias('dashboard'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user