From 00ac0894bb2da85bbd3f8b10f914afe1a7a9be64 Mon Sep 17 00:00:00 2001 From: "victor.soulier" Date: Sun, 19 Nov 2023 12:52:33 +0100 Subject: [PATCH] =?UTF-8?q?ADD=20:=20redirection=20vers=20le=20controleur?= =?UTF-8?q?=20du=20jeu=20associ=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/src/controller/JouerController.php | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/project/src/controller/JouerController.php b/project/src/controller/JouerController.php index 3adb773..3aad794 100644 --- a/project/src/controller/JouerController.php +++ b/project/src/controller/JouerController.php @@ -2,6 +2,7 @@ namespace controller; use config\Validation; +use Exception; use model\ValidationException; class JouerController{ @@ -22,15 +23,23 @@ class JouerController{ } if(count($dVueErreur) == 0){ - $pseudo = $role->getPseudo(); - $nomJeu = $configurationJeu->getJeu()->getNom(); - $libelleDifficulte = $configurationJeu->getDifficulte()->getLibelle(); + // $pseudo = $role->getPseudo(); + $idJeu = $configurationJeu->getJeu()->getId(); + // $libelleDifficulte = $configurationJeu->getDifficulte()->getLibelle(); - $dVue["nomJeu"] = $nomJeu; - $dVue["pseudo"] = $pseudo; - $dVue["libelleDifficulte"] = $libelleDifficulte; + // $dVue["nomJeu"] = $nomJeu; + // $dVue["pseudo"] = $pseudo; + // $dVue["libelleDifficulte"] = $libelleDifficulte; - echo $twig->render($config["templates"]["jouer"], ["dVue"=>$dVue]); + //echo $twig->render($config["templates"]["jouer"], ["dVue"=>$dVue]); + switch($idJeu){ + case 3: + new PenduController($role, $configurationJeu); + break; + default: + throw new Exception("Jeu non défini !"); + break; + } } }else{ header("Location: .");