php - How can solve fetal error while adding action? -


how can remove fatal error applying following code controller.php

public function actionuser() {   $model= new userform();      if($model->load(yii::$app->request->post()) && $model->validate())     {         //lates wirite later         }else{         return $this->render('userform',['model'=>$model]);     } 

and userform models code:

class userform extends model { public $name; public $email;  public function rules() {      return[             [['name','email'],'required'],             ['email','email'],             ];    } } 

and views code:

use yii\helpers\html;  use yii\widgets\activeforms;  $form=activeform::begin();  echo $form->field($model,'name');  echo $form->field($model,'email');   echo html::submitbutton('submit',['class'=>'btn btn-success']); 

enter image description here }


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -