wip: functionality for new role 'management'

This commit is contained in:
Björn Fromme
2024-02-14 14:59:47 +01:00
parent 7f05cf30b6
commit 7c7addf531
17 changed files with 312 additions and 68 deletions
@@ -0,0 +1,42 @@
<?php
namespace App\Controller\Administrative\Feedback;
use App\Repository\FeedbackRepository;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class IndexController extends AbstractController
{
public function __construct(
private readonly FeedbackRepository $feedbackRepository,
private readonly PaginatorInterface $paginator
) {
}
#[Route('/administrative/feedback', name: 'app_administrative_feedback_index')]
public function index(Request $request): Response
{
$query = $this
->feedbackRepository
->getListQuery()
;
$pagination = $this->paginator->paginate(
$query,
$request->query->getInt('page', 1),
10,
[
'defaultSortFieldName' => 'feedback.createdAt',
'defaultSortDirection' => 'desc',
]
);
return $this->render('administrative/feedback/index.html.twig', [
'pagination' => $pagination,
]);
}
}