Answer the question
In order to leave comments, you need to log in
Call to a member function hasErrors() on null?
Good afternoon, I'm trying to make a button where, when clicked, a form opens. But an error occurs:
Call to a member function hasErrors() on null
if ($this->model->hasErrors($attributeName)) {
Html::addCssClass($options, $this->form->errorCssClass);
}
public function actionInsert() {
$time = new Feedback();
if ($time->load(Yii::$app->request->post())) {
if ($time->insert()) {
return $this->redirect(['page/index']);
}
Yii::$app->session->setFlash(
'success',
false
);
}
return $this->render('insert', ['time' => $time]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question