public function UserController::userPage in Drupal 8
Same name and namespace in other branches
- 9 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::userPage()
Redirects users to their profile page.
This controller assumes that it is only invoked for authenticated users. This is enforced for the 'user.page' route with the '_user_is_logged_in' requirement.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse Returns a redirect to the profile of the currently logged in user.
1 string reference to 'UserController::userPage'
- 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 280
Class
- UserController
- Controller routines for user routes.
Namespace
Drupal\user\ControllerCode
public function userPage() {
return $this
->redirect('entity.user.canonical', [
'user' => $this
->currentUser()
->id(),
]);
}