backend/controllers/AdminsController.php
/**
     * Deletes an existing Admins 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 Admins 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 Admins 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)
    {
        if ($this->Admins->admin_id != $id) {
            $this->findModel($id)->delete();
        } else {
            Yii::$app->session->setFlash('error', "You can't delete yourself.");
        }
        return $this->redirect(['index']);
    }
public function actionDelete ( $ id ) { if ( $ this -> Admins -> admin_id != $ id ) { $ this -> findModel ( $ id ) -> delete ( ) ; } else { Yii :: $ app -> session -> setFlash ( 'error' , " You can't delete yourself. " ) ; } return $ this -> redirect ( [ 'index' ] ) ; }
Deletes an existing Admins model.
Deletes an existing Admins model .