php - syntax error, unexpected '$model' (T_VARIABLE) form yii2 -
i'm beginner learn yii2.
i getting error:
syntax error, unexpected '$model' (t_variable) form yii2
here code:
public function actionforms(){ $model = new form11(); // <<error on line if ($model->load(yii::$app->request->post()) && $model->save()) { yii::$app->session->setflash('contactformsubmitted');
check 2 things ...
- you have created model named form11 in
/models
directory. (with name space) - include model in controller file.
Comments
Post a Comment