DocumentController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace DocumentBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. class DocumentController extends Controller
  8. {
  9. /**
  10. * @Route("/message/{prenom}/{nom}/{age}"
  11. * , name="document_message"
  12. * , requirements={"nom":"[A-Z][a-z]*"}
  13. * )
  14. */
  15. public function messageAction (Request $request, $prenom, $nom, $age)
  16. {
  17. $tableau = array ();
  18. $tableau[] = array(
  19. 'nom' => 'Dupond',
  20. 'prenom'=> 'Jean'
  21. );
  22. $tableau[] = array(
  23. 'nom' => 'Drouhard',
  24. 'prenom'=> 'François'
  25. );
  26. $tableau[] = array(
  27. 'nom' => 'Corniolle',
  28. 'prenom'=> 'Alex'
  29. );
  30. $tableau[] = array(
  31. 'nom' => 'Roubloublou',
  32. 'prenom'=> 'Lulu'
  33. );
  34. return $this->render("@Document\Document\index.html.twig", array(
  35. "tableau" => $tableau
  36. ));
  37. }
  38. }