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');