public function actionAddtask() { $model = new TaskForm(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { Yii::$app->session->setFlash('contactFormSubmitted', 'success'); return $this->refresh(); } else { return $this->render('add_task', ['model' => $model]); } }
public function actionIndex() { $models = TaskForm::find()->all(); echo $this->render('index', array('models' => $models)); }