You are here

public function UserController::logout in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::logout()

Logs the current user out.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirection to home page.

1 string reference to 'UserController::logout'
user.routing.yml in core/modules/user/user.routing.yml
core/modules/user/user.routing.yml

File

core/modules/user/src/Controller/UserController.php, line 175
Contains \Drupal\user\Controller\UserController.

Class

UserController
Controller routines for user routes.

Namespace

Drupal\user\Controller

Code

public function logout() {
  user_logout();
  return $this
    ->redirect('<front>');
}