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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

java - How to implement an entity bound odata action in olingo v4.3 -