/** * Deletes an existing User model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $model = new UserForm(); $session = Yii::$app->session; if ($model->deleteUser($id)) { $session->setFlash('info', Yii::t('back', 'User successfully deleted!')); } else { $session->setFlash('info', Yii::t('back', 'Something went wrong - user not deleted!')); } return $this->redirect(['index']); }