コード例 #1
0
 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}'");
 }
コード例 #2
0
 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);
 }