Yii2 active record model not saving data

后端 未结 7 672
情话喂你
情话喂你 2020-12-16 17:47

I\'ve built a simple form model & view, a simple AR model, and a simple controller. The form model assigns the correct values to the AR instance, but when I call save(),

7条回答
  •  别那么骄傲
    2020-12-16 18:14

    For who is struggling with this problem, I would remember to check the beforeSave method, if present. I mistakenly commented out the return statement.

    public function beforeSave($insert)
    {
        // never toggle comment on this!!!
        return parent::beforeSave( $insert); 
    }
    

提交回复
热议问题