private function editCategory() { if (isset($_POST['editcategory'])) { $ctg = new Category($_GET["id"]); $ctg->edit($_POST['name'], $_POST['image']); header("Location: home.php"); } $ctg = new Category($_GET["id"]); $data = array('category' => $ctg->getInfos()); $this->loadView('cm_editcategory', $data); }