36 lines
942 B
PHP
36 lines
942 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Core\Controller\Dashboard\DashboardAdminController as Controller;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
use App\Repository\Blog\PostRepositoryQuery;
|
|
use App\Repository\ProjectRepositoryQuery;
|
|
|
|
#[Route(path: '/admin')]
|
|
class DashboardAdminController extends Controller
|
|
{
|
|
#[Route(path: '/', name: 'admin_dashboard_index')]
|
|
public function index(
|
|
PostRepositoryQuery $postQuery,
|
|
ProjectRepositoryQuery $projectQuery
|
|
): Response
|
|
{
|
|
$posts = $postQuery->create()
|
|
->orderBy('.id', 'DESC')
|
|
->paginate(1, 4)
|
|
;
|
|
|
|
$projects = $projectQuery->create()
|
|
->orderBy('.id', 'DESC')
|
|
->paginate(1, 3)
|
|
;
|
|
|
|
return $this->render('admin/dashboard.html.twig', [
|
|
'posts' => $posts,
|
|
'projects' => $projects,
|
|
]);
|
|
}
|
|
}
|