src/DEVWEB/ColocationBundle/Controller/AdvertController.php
// controller de la vue index.html.twig
controller de la vue index.html.twig
controller de la vue index . html . twig
public function indexAction($page)
  {
    if ($page < 1) {
      throw new NotFoundHttpException('Page "'.$page.'" inexistante.');
    }
    $listAdverts = $this->getDoctrine()
      ->getManager()
      ->getRepository('DEVWEBColocationBundle:Advert')
      ->findAll()
    ;
    return $this->render('@DEVWEBColocation/Advert/index.html.twig', array(
      'listAdverts' => $listAdverts,
    ));
  }
public function indexAction ( $ page ) { if ( $ page < 1 ) { throw new NotFoundHttpException ( 'Page "' . $ page . '" inexistante.' ) ; } $ listAdverts = $ this -> getDoctrine ( ) -> getManager ( ) -> getRepository ( 'DEVWEBColocationBundle:Advert' ) -> findAll ( ) ; return $ this -> render ( '@DEVWEBColocation/Advert/index.html.twig' , array ( 'listAdverts' => $ listAdverts , ) ) ; }
controller de la vue index.html.twig
controller de la vue index . html . twig