Bonjour,
j'ai des cours mais mon problème c'est que tout mes cours s'affiche dans la même page je fais un findAll() voici mon controlleur
au niveau du twig je fais une boucle pour afficher le tout je sais pas quoi faire pour afficher par exemple 8 cours dans chaque page
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 public function coursAction() { $cours = $this->getDoctrine()->getManager()->getRepository('ITLessonsBlogBundle:Cours') ->findBy(array(), array('id' => 'desc')); if ($cours === null) { throw $this->createNotFoundException('Aucun cours n\' a été récupéré'); } return $this->render('ITLessonsBlogBundle:cours:cours.html.twig', array('cours' => $cours)); }
Partager