From bb04f79f9bcbd5afec5bca2d6d22b3345866dead Mon Sep 17 00:00:00 2001 From: Lucie GOIGOUX Date: Sun, 19 Nov 2023 12:50:29 +0100 Subject: [PATCH] =?UTF-8?q?d=C3=A9but=20memory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/php/controller/AbsController.php | 14 ++++++++++++++ Project/php/controller/FrontController.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Project/php/controller/AbsController.php b/Project/php/controller/AbsController.php index 0dd5f91..f364ce2 100644 --- a/Project/php/controller/AbsController.php +++ b/Project/php/controller/AbsController.php @@ -4,6 +4,8 @@ namespace controller; use config\Validation; use Exception; +use gateway\TranslationGateway; +use gateway\VocabularyListGateway; use model\MdlStudent; use model\VocabularyList; @@ -60,5 +62,17 @@ abstract class AbsController public function memory(): void{ global $twig; + + try{ + $idVoc = Validation::filter_int($_GET['id'] ?? null); + $wordList = (new \gateway\TranslationGateway)->findByIdVoc($idVoc); + + } + catch (Exception $e){ + throw new Exception("Erreur"); + } + + + echo $twig->render('memory.html'); } } \ No newline at end of file diff --git a/Project/php/controller/FrontController.php b/Project/php/controller/FrontController.php index 2ca5bdd..32b710d 100755 --- a/Project/php/controller/FrontController.php +++ b/Project/php/controller/FrontController.php @@ -20,7 +20,7 @@ class FrontController $router->setBasePath($altorouterPath); $router->map('GET', '/', 'AppController'); - $router->map('GET|POST', '/[a:action]?', 'NULL'); + $router->map('GET|POST', '/[a:action]?/[i:id]?', 'NULL'); $router->map('GET|POST', '/admin/[i:id]/[a:action]?', 'Admin'); $router->map('GET|POST', '/teacher/[i:id]/[a:action]?', 'Teacher'); $router->map('GET|POST', '/student/[i:id]/[a:action]?', 'Student');