public static function doCommentaire($idActivite, $idParent) { switch ($_SERVER['REQUEST_METHOD']) { case 'GET': break; case 'POST': if (isset($_SESSION['user'])) { $c = new Commentaire(1, $idParent, $_SESSION['idUser'], $idActivite, '', $_POST['contenu']); $c->add(); self::show($idActivite); } else { $_SESSION['message']['type'] = 'error'; $_SESSION['message']['text'] = "You aren't connected"; include 'views/connexion.php'; } break; } }