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 ...

  1. you have created model named form11 in /models directory. (with name space)
  2. include model in controller file.

Comments

Popular posts from this blog

javascript - Knockout pushing observable and computed data to an observable array -

'hasOwnProperty' in javascript -

Trouble making a JSON string -