public function actionEntry() { $model = new \app\models\EntryForm(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { return $this->render('comfirm-entry', ['model' => $model]); } else { return $this->render('entry', ['model' => $model]); } }
public function actionEntry() { //$model = new EntryForm(); $model = new \app\models\EntryForm(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { // valid data received in $model // do something meaningful here about $model ... return $this->render('entry-confirm', ['model' => $model]); } else { // either the page is initially displayed or there is some validation error return $this->render('entry', ['model' => $model]); } }