original_string: public function actionDelete($id)
      {
          if (Admin::find()->count() == 1) {
              Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'This is the last administrator, delete can not manage the system, it can not be deleted!'));
              return $this->redirect(['index']);
          }
          $this->findModel($id)->delete();
          Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Delete success.'));
          return $this->redirect(['index']);
      }
code: public function actionDelete($id)
      {
          if (Admin::find()->count() == 1) {
              Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'This is the last administrator, delete can not manage the system, it can not be deleted!'));
              return $this->redirect(['index']);
          }
          $this->findModel($id)->delete();
          Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Delete success.'));
          return $this->redirect(['index']);
      }
code_tokens: public function actionDelete ( $ id ) { if ( Admin :: find ( ) -> count ( ) == 1 ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'yuncms' , 'This is the last administrator, delete can not manage the system, it can not be deleted!' ) ) ; return $ this -> redirect ( [ 'index' ] ) ; } $ this -> findModel ( $ id ) -> delete ( ) ; Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'yuncms' , 'Delete success.' ) ) ; return $ this -> redirect ( [ 'index' ] ) ; }
docstring: Deletes an existing Admin model.
  If deletion is successful, the browser will be redirected to the 'index' page.
  
  @param integer $id
  @return mixed
  @throws NotFoundHttpException
  @throws \Exception
  @throws \Throwable
  @throws \yii\db\StaleObjectException
docstring_tokens: Deletes an existing Admin model . If deletion is successful the browser will be redirected to the index page .