} // получение единственного экземпляра public static function Instance() { if (self::$instance == null) { self::$instance = new M_Article(); }
protected function action_edit() { $mArticles = M_Article::Instance(); $this->edit_Only = $mArticles->edit_Only(); $this->title_h1 .= '::Редактирование выбраной статьи'; // Обработка отправки формы. if (!empty($_POST)) { if ($mArticles->edit_post($_POST['title'], $_POST['content'], $_POST['date'], $_POST['autor'])) { header('Location: index.php?c=editor&act=editor'); die; } $title = $_POST['title']; $content = $_POST['content']; $error = true; } else { $title = ''; $content = ''; $error = false; } $this->content = $this->Template('v/v_edit.php', array('variable' => $this->edit_Only)); }