function UserController::userEditPage

Same name in other branches
  1. 9 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::userEditPage()
  2. 8.9.x core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::userEditPage()
  3. 10 core/modules/user/src/Controller/UserController.php \Drupal\user\Controller\UserController::userEditPage()

Redirects users to their profile edit page.

This controller assumes that it is only invoked for authenticated users. This is typically enforced with the '_user_is_logged_in' requirement.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse Returns a redirect to the profile edit form of the currently logged in user.

1 string reference to 'UserController::userEditPage'
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 372

Class

UserController
Controller routines for user routes.

Namespace

Drupal\user\Controller

Code

public function userEditPage() {
    return $this->redirect('entity.user.edit_form', [
        'user' => $this->currentUser()
            ->id(),
    ], [], 302);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.