|
@@ -136,12 +136,23 @@ class VideothequeListController extends AbstractController
|
|
|
$qb = $filmRepository->queryFilmWithReal([$realisateur->getNomComplet()], $filtersForm->getData()->page, $filtersForm->getData()->toArray());
|
|
|
$pagination = new Pagination($qb, $filtersForm->getData()->limit, $filtersForm->getData()->page);
|
|
|
|
|
|
- return $this->render('videotheque/liste_'.$options->vue().'.html.twig', array(
|
|
|
+ return $this->render('videotheque/liste_'.$options->vue().'.html.twig', [
|
|
|
'listeFilms' => $pagination->getPaginator(),
|
|
|
'titre' => 'Films par réalisateur : ' . $realisateur->getNomComplet(),
|
|
|
'filtersForm' => $filtersForm->createView(),
|
|
|
'pagination' => $pagination
|
|
|
- ));
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ #[Route('/pif', name: 'videotheque_random')]
|
|
|
+ public function randomAction(FilmRepository $filmRepository, OptionsManager $options): Response
|
|
|
+ {
|
|
|
+ $films = $filmRepository->findRandom(5);
|
|
|
+
|
|
|
+ return $this->render('videotheque/liste_'.$options->vue().'.html.twig', [
|
|
|
+ 'listeFilms' => $films,
|
|
|
+ 'titre' => '5 films au hasard'
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
#[Route("/fichefilm/{id}", name: "videotheque_voirfilm")]
|