public function edit() { if (!isset($_GET['id'])) { header('Location: index.php'); } $class = new MArticles(); if (!empty($_POST) && (int) $_GET['id'] > 0) { $_POST['id'] = $_GET['id']; foreach ($_POST as $key => $value) { if ($value == '') { header('location: index.php'); } } $class->edit($_POST); header('location: index.php'); } $view = new View(); $view->data = $class->one($_GET['id']); $view->views('article_admin'); }