Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /**
  2. * AutoComplete Action
  3. *
  4. * @Route("/auto", name="individuos_auto")
  5. *
  6. */
  7. public function autocompleteAction()
  8. {
  9. $em = $this->getDoctrine()->getEntityManager();
  10. $qb = $em->createQueryBuilder();
  11.  
  12. $entities = $em->getRepository('AcmeParqueBundle:Especies')->findAll();
  13. foreach ($entities as $entity) {
  14. $array[] = $entity->getNombrecomun();
  15. }
  16. return $this->render('AcmeParqueBundle:Main:searchresults.html.twig',array('resultados',json_encode($array)));
  17. }
Add Comment
Please, Sign In to add comment