diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 58cc2a8..674f81e 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -3,7 +3,7 @@ namespace App\Controller; use App\Connexion; - +use App\Controller\Sub\EditorController; use App\Gateway\TacticInfoGateway; use App\Gateway\TeamGateway; use App\Http\HttpResponse; @@ -13,7 +13,6 @@ use App\Model\TeamModel; use App\Session\SessionHandle; class UserController extends VisitorController { - public function home(): HttpResponse { $model = new TacticModel(new TacticInfoGateway(new Connexion(get_database()))); $listTactic = $model->getLast(5); @@ -27,12 +26,12 @@ class UserController extends VisitorController { public function edit(int $id, SessionHandle $session): HttpResponse { $model = new TacticModel(new TacticInfoGateway(new Connexion(get_database()))); - return (new Sub\EditorController($model))->edit($id, $session); + return (new EditorController($model))->edit($id, $session); } public function create(SessionHandle $session): HttpResponse { $model = new TacticModel(new TacticInfoGateway(new Connexion(get_database()))); - return (new Sub\EditorController($model))->createNew($session); + return (new EditorController($model))->createNew($session); } public function open(int $id, SessionHandle $session): HttpResponse { diff --git a/src/Gateway/TacticInfoGateway.php b/src/Gateway/TacticInfoGateway.php index c2db146..56e9b42 100644 --- a/src/Gateway/TacticInfoGateway.php +++ b/src/Gateway/TacticInfoGateway.php @@ -40,7 +40,7 @@ class TacticInfoGateway { */ public function getLast(int $nb) : ?array { $res = $this->con->fetch( - "SELECT * FROM TacticInfo ORDER BY creation_date DESC LIMIT :nb ", + "SELECT * FROM Tactic ORDER BY creation_date DESC LIMIT :nb ", [":nb" => [$nb, PDO::PARAM_INT]] ); if (count($res) == 0) { diff --git a/src/Views/home.twig b/src/Views/home.twig index 1c14e02..1429363 100644 --- a/src/Views/home.twig +++ b/src/Views/home.twig @@ -73,13 +73,13 @@

Mes strategies

- + {% if recentTactic != null %} {% for tactic in recentTactic %} -
+

{{tactic.id}} - {{tactic.name}} - {{tactic.creation_date}}

- +
{% endfor %} {% else %}