123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace DocumentBundle\Controller;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- use Symfony\Component\Routing\Annotation\Route;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- class DocumentController extends Controller
- {
- /**
- * @Route("/message/{prenom}/{nom}/{age}"
- * , name="document_message"
- * , requirements={"nom":"[A-Z][a-z]*"}
- * )
- */
- public function messageAction (Request $request, $prenom, $nom, $age)
- {
- $tableau = array ();
- $tableau[] = array(
- 'nom' => 'Dupond',
- 'prenom'=> 'Jean'
- );
- $tableau[] = array(
- 'nom' => 'Drouhard',
- 'prenom'=> 'François'
- );
- $tableau[] = array(
- 'nom' => 'Corniolle',
- 'prenom'=> 'Alex'
- );
- $tableau[] = array(
- 'nom' => 'Roubloublou',
- 'prenom'=> 'Lulu'
- );
- return $this->render("@Document\Document\index.html.twig", array(
- "tableau" => $tableau
- ));
- }
- }
|