function ControllerBase::currentUser
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::currentUser()
- 8.9.x core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::currentUser()
- 11.x core/lib/Drupal/Core/Controller/ControllerBase.php \Drupal\Core\Controller\ControllerBase::currentUser()
Returns the current user.
Return value
\Drupal\Core\Session\AccountInterface The current user.
1 call to ControllerBase::currentUser()
- UserController::resetPass in core/
modules/ user/ src/ Controller/ UserController.php - Redirects to the user password reset form.
File
-
core/
lib/ Drupal/ Core/ Controller/ ControllerBase.php, line 232
Class
- ControllerBase
- Utility base class for thin controllers.
Namespace
Drupal\Core\ControllerCode
protected function currentUser() {
if (!$this->currentUser) {
$this->currentUser = $this->container()
->get('current_user');
}
return $this->currentUser;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.