src/controllers/SiteController.php
public function actionLogout()
    {
        Yii::$app->user->logout();
        $back = Yii::$app->request->post('back') ?: Yii::$app->request->get('back');

        return $back ? $this->redirect($back) : $this->goHome();
    }
public function actionLogout()
    {
        Yii::$app->user->logout();
        $back = Yii::$app->request->post('back') ?: Yii::$app->request->get('back');

        return $back ? $this->redirect($back) : $this->goHome();
    }
public function actionLogout ( ) { Yii :: $ app -> user -> logout ( ) ; $ back = Yii :: $ app -> request -> post ( 'back' ) ? : Yii :: $ app -> request -> get ( 'back' ) ; return $ back ? $ this -> redirect ( $ back ) : $ this -> goHome ( ) ; }
Logout action.
@return string
Logout action .