There is a method that displays one news:
public function actionOne() { $id_article = $_GET['id']; $onenews = NewsModel::getOne($id_article); $view = new View(); $view->listonenews = $onenews; $view->display('adminnews/one.php'); // Здесь происходит обновление записей, данные приходят из формы $onenews->title = $_POST['title']; $onenews->date = $_POST['date']; $onenews->text = $_POST['text']; $onenews->updateNews(); }
The problem is that the same page processes the form and, therefore, warnings are displayed on the screen, because the data from the form has not yet arrived:
Notice: Undefined index: title
and so with all the fields I'm going to update.
Please tell me how you can fix this moment.