render('elimination/index.html.twig', [ 'controller_name' => 'EliminationController', ]); } #[Route('/elimination/{seasonCode}/{candidateHash}', name: 'app_elimination_cadidate')] #[IsGranted(SeasonVoter::ELIMINATION, 'season')] public function candidateScreen(Season $season, string $candidateHash, CandidateRepository $candidateRepository): Response { $candidate = $candidateRepository->getCandidateByHash($season, $candidateHash); if (!$candidate instanceof Candidate) { $this->addFlash(FlashType::Warning, t('Cound not find candidate with name %name%', ['%name%' => Base64::base64UrlDecode($candidateHash)])->trans($this->translator) ); throw new \InvalidArgumentException('Candidate not found'); } return $this->render('elimination/candidate.html.twig', [ 'season' => $season, 'candidate' => $candidate, ]); } }