public function __construct() { parent::__construct(); if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['comment'])) { $this->addcomment(); } }
public function __construct() { parent::__construct(); $this->comments = new Comments(); if (!empty($_GET['id'])) { $this->viewpost($_GET['id']); } else { $this->getposts(); } }
public function __construct() { parent::__construct(); }