src/DEVWEB/ColocationBundle/Controller/AdvertController.php
// controller de la vue menu.html.twig
controller de la vue menu.html.twig
controller de la vue menu . html . twig
public function menuAction($limit)
  {
    $em = $this->getDoctrine()->getManager();
    $listAdverts = $em->getRepository('DEVWEBColocationBundle:Advert')->findBy(
      array(),
      array('date' => 'desc'),
      $limit,
      0
    );
  return $this->render('@DEVWEBColocation/Advert/menu.html.twig', array(
    'listAdverts' => $listAdverts
  ));
  }
public function menuAction ( $ limit ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ listAdverts = $ em -> getRepository ( 'DEVWEBColocationBundle:Advert' ) -> findBy ( array ( ) , array ( 'date' => 'desc' ) , $ limit , 0 ) ; return $ this -> render ( '@DEVWEBColocation/Advert/menu.html.twig' , array ( 'listAdverts' => $ listAdverts ) ) ; }
controller de la vue menu.html.twig
controller de la vue menu . html . twig