model->save() Not Working In Yii2

后端 未结 10 1547
情歌与酒
情歌与酒 2020-12-06 01:10

Previously, I was not using $model->save() function for inserting or updating any data. I was simply using createCommand() to execute query and

10条回答
  •  执念已碎
    2020-12-06 01:55

    I guess $model->load() returns false, call $model->errors to see model's error.

    $model->load();
    $model->validate();
    var_dump($model->errors);
    

提交回复
热议问题