ADD : redirection vers le controleur du jeu associé

correction_routeur^2
Victor SOULIER 1 year ago
parent 18deb474a2
commit 00ac0894bb

@ -2,6 +2,7 @@
namespace controller; namespace controller;
use config\Validation; use config\Validation;
use Exception;
use model\ValidationException; use model\ValidationException;
class JouerController{ class JouerController{
@ -22,15 +23,23 @@ class JouerController{
} }
if(count($dVueErreur) == 0){ if(count($dVueErreur) == 0){
$pseudo = $role->getPseudo(); // $pseudo = $role->getPseudo();
$nomJeu = $configurationJeu->getJeu()->getNom(); $idJeu = $configurationJeu->getJeu()->getId();
$libelleDifficulte = $configurationJeu->getDifficulte()->getLibelle(); // $libelleDifficulte = $configurationJeu->getDifficulte()->getLibelle();
$dVue["nomJeu"] = $nomJeu; // $dVue["nomJeu"] = $nomJeu;
$dVue["pseudo"] = $pseudo; // $dVue["pseudo"] = $pseudo;
$dVue["libelleDifficulte"] = $libelleDifficulte; // $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{ }else{
header("Location: ."); header("Location: .");

Loading…
Cancel
Save