protected function enregistrer_commentaireAction() { $article_id = $_POST['article_id']; $contenu = $_POST['contenu']; $am = new \Modele\CommentaireManager(); $newcommentaire = $am->envoyerCommentaire($contenu, $article_id); header("Location: app.php?action=detail&id='{$article_id}'"); }
protected function detailAction() { $id = $_GET['id']; $am = new \Modele\ArticleManager(); $article = $am->getArticle($id); // $data = ['titre' => 'detai l de article']; $data = ['article' => $article]; $com = new \Modele\CommentaireManager(); $commentaires = $com->getTousLesCommentaires($id); $data = ['article' => $article, 'commentaires' => $commentaires]; $this->render('detail.html.php', $data); }