diff --git a/config/config.php b/config/config.php index cd389e1..792db41 100644 --- a/config/config.php +++ b/config/config.php @@ -10,8 +10,8 @@ $rep = __DIR__ . '/../'; //BD $base = 'dbkemondejar'; -$login = ''; -$mdp = ''; +$login = 'kemondejar'; +$mdp = 'Ctvl-21122005'; //Vues $vues['erreur'] = 'vue/erreur.php'; diff --git a/index.php b/index.php index bebf483..c8e83c7 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=localhost;dbname={$base};", $login, $mdp); //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(); session_unset(); session_destroy(); diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php index 8b3cd3c..d0fbdfc 100644 --- a/src/Controleur/VisitorControler.php +++ b/src/Controleur/VisitorControler.php @@ -1,8 +1,17 @@ qMod = new QuoteModel(new QuoteGateway($co)); + } + public function accueil(){ global $vues; require_once $vues['accueil']; @@ -11,7 +20,7 @@ Class VisitorControler{ public function quote(array $arg){ global $vues; $id=$arg['idQuote'] ?? 1; - + $q = $qMod->searchId($id); //echo "{$id}"; require_once $vues['quote']; diff --git a/vue/quote.php b/vue/quote.php index 809a8c1..e71364b 100644 --- a/vue/quote.php +++ b/vue/quote.php @@ -1,6 +1,6 @@ render('head.html.twig', array( 'title' => "Quote",