From 32fc6dc68bed9da067fd8c99c1d4c635fb621e38 Mon Sep 17 00:00:00 2001 From: beaulaton Date: Wed, 6 Nov 2024 17:07:15 +0100 Subject: [PATCH] Lien avec la page Quiz, login, signit --- config/config.php | 2 +- index.php | 4 ++-- src/Controleur/FrontControler.php | 15 ++++++++++++--- src/Gateway/Connection.php | 6 +++--- vue/templates/bandeau.html.twig | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/config/config.php b/config/config.php index e6cd36f..70ce410 100644 --- a/config/config.php +++ b/config/config.php @@ -9,7 +9,7 @@ $rep = __DIR__ . '/../'; //BD -$base = 'dbkemondejar'; +$base = ''; $login = ''; $mdp = ''; diff --git a/index.php b/index.php index bebf483..6e8b364 100644 --- a/index.php +++ b/index.php @@ -11,7 +11,7 @@ require_once __DIR__ . '/config/config.php'; require __DIR__ . '/vendor/autoload.php'; -$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbwikifantasy;', 'kiem', ''); +//$co = new \Gateway\Connection("pgsql:host=londres;dbname=dblebeaulato","lebeaulato","MaSQL:2004!"); //twig $loader = new \Twig\Loader\FilesystemLoader('vue/templates'); @@ -20,7 +20,7 @@ $twig = new \Twig\Environment($loader, [ ]); -$cont = new Controleur\FrontControler($co); +$cont = new Controleur\FrontControler(/*$co*/); session_unset(); session_destroy(); diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php index d623a4c..78dceb5 100644 --- a/src/Controleur/FrontControler.php +++ b/src/Controleur/FrontControler.php @@ -1,14 +1,20 @@ listAction = ['visitor' => array('accueil','search','quote','login','signin'), 'user' => array('quiz','commentary','favorite','logout'), @@ -32,14 +38,17 @@ Class FrontControler{ $router->map('GET|POST', '/quote/[i:idQuote]?', 'VisitorControler'); $router->map('GET|POST', '/login', 'VisitorControler'); $router->map('GET|POST', '/signin', 'VisitorControler'); + $router->map('GET|POST', '/quiz', 'UserControler'); + $router->map('GET|POST', '/quiz/[i:id]?', 'QuizControler'); + $match = $router->match(); $action = NULL; if(!$match){ - $dVueEreur[] = "Requette introuvable"; + $dVueEreur[] = "Requête introuvable"; $this->vueErreur($dVueEreur); } else{ diff --git a/src/Gateway/Connection.php b/src/Gateway/Connection.php index bf6ae67..8725f0c 100644 --- a/src/Gateway/Connection.php +++ b/src/Gateway/Connection.php @@ -1,14 +1,14 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } diff --git a/vue/templates/bandeau.html.twig b/vue/templates/bandeau.html.twig index 4c84aa7..567f11a 100644 --- a/vue/templates/bandeau.html.twig +++ b/vue/templates/bandeau.html.twig @@ -2,7 +2,7 @@