Controller routines for user routes.
Expanded class hierarchy of UserController
class UserController implements ControllerInterface {
/**
* Constructs an UserController object.
*/
public function __construct() {
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static();
}
/**
* Logs the current user out.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* A redirection to home page.
*/
public function logout(Request $request) {
user_logout();
// @todo Remove the destination check once drupal.org/node/1668866 is in.
$url = $request->query
->get('destination') ?: '<front>';
return new RedirectResponse(url($url, array(
'absolute' => TRUE,
)));
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UserController:: |
public static | function |
Instantiates a new instance of this controller. Overrides ControllerInterface:: |
|
UserController:: |
public | function | Logs the current user out. | |
UserController:: |
public | function | Constructs an UserController object. |