modules/admin/controllers/UserController.php
/**
     * Deletes an existing User model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Deletes an existing User model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Deletes an existing User model . If deletion is successful the browser will be redirected to the ' index ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $email = $model->email;
        $request = Request::findOne(['email'=>$email])->delete();
        $this->findModel($id)->delete();
        $auth   =   \Yii::$app->authManager ;
        $auth->revokeAll( $id ) ;
        return $this->redirect(['index']);
    }
public function actionDelete ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ email = $ model -> email ; $ request = Request :: findOne ( [ 'email' => $ email ] ) -> delete ( ) ; $ this -> findModel ( $ id ) -> delete ( ) ; $ auth = \ Yii :: $ app -> authManager ; $ auth -> revokeAll ( $ id ) ; return $ this -> redirect ( [ 'index' ] ) ; }
Deletes an existing User model.
Deletes an existing User model .
//при удалении пользователя - его заявка тоже удаляется // метод ниже очищает все права пользователя с id = $id