render('conference/index.html.twig', [ 'conferences' => $conferenceRepository->findAll(), ]); } #[Route('/conference/{slug}', name: 'conference')] public function show(Request $request, Conference $conference, CommentRepository $commentRepository): Response { $offset = max(0, $request->query->getInt('offset', 0)); $paginator = $commentRepository->getCommentPaginator($conference, $offset); return $this->render('conference/show.html.twig', [ 'conference' => $conference, 'comments' => $paginator, 'previous' => $offset - CommentRepository::COMMENTS_PER_PAGE, 'next' => min(count($paginator), $offset + CommentRepository::COMMENTS_PER_PAGE) ]); } }