ADD : affichage du jeu et difficulté selectionnés

correction_routeur^2
Victor SOULIER 1 year ago
parent 7033bb4c1f
commit 8265694bf0

@ -127,11 +127,12 @@ class FrontController
{ {
global $twig; global $twig;
$game = $_POST['jeu'] ?? ''; $id_jeu = $_POST['jeu'] ?? '';
$difficulty = $_POST['difficulte'] ?? ''; $id_difficulte = $_POST['difficulte'] ?? '';
\config\Validation::val_form($game, $difficulty, $dVueErreur); \config\Validation::val_form($id_jeu, $id_difficulte, $dVueErreur);
$dVue['info'] = "Jeu '$game' créé avec la difficulté $difficulty"; $dVue['nomJeu'] = (new \model\JeuGateway($this->con))->getFromId($id_jeu)->getNom();
$dVue['libelleDifficulte'] = (new \model\DifficulteGateway($this->con))->getFromId($id_difficulte)->getLibelle();
echo $twig->render('accueil.html', ['dVue' => $dVue, 'dVueErreur' => $dVueErreur]); echo $twig->render('accueil.html', ['dVue' => $dVue, 'dVueErreur' => $dVueErreur]);
} }

@ -14,9 +14,14 @@
<body> <body>
<h1>Bienvenue sur Mini-Jeux</h1> <h1>Bienvenue sur Mini-Jeux</h1>
{% if dVue.info is defined %} <!--TODO A DEPLACER DANS SA PROPRE VUE-->
<p>{{dVue.info}}</p> {% if dVue.nomJeu is defined %}
<p>Jeu selectionné : {{dVue.nomJeu}}</p>
{% endif %} {% endif %}
{% if dVue.libelleDifficulte is defined %}
<p>Difficulte selectionné : {{dVue.libelleDifficulte}}</p>
{% endif %}
<!--FIN TODO-->
{% if dVue.pseudo is defined %} {% if dVue.pseudo is defined %}
<p align="right"><a href="logout">{{dVue.pseudo}}</a></p> <p align="right"><a href="logout">{{dVue.pseudo}}</a></p>

Loading…
Cancel
Save