/** * */ public function add() { $view = new View(); $view->header = "Добавить новость"; $view->render('addnews.html'); // include __DIR__ . '/../views/addnews.html'; if (isset($_POST['title']) && !empty($_POST['title'])) { if (isset($_POST['text']) && !empty($_POST['text'])) { $title = $_POST['title']; $text = $_POST['text']; NewsModel::addNews($title, $text); } } }
public static function main() { $view = new View(); $view->render('index.html'); }