function FormBase::currentUser

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::currentUser()

Gets the current user.

Return value

\Drupal\Core\Session\AccountInterface The current user.

File

core/lib/Drupal/Core/Form/FormBase.php, line 191

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function currentUser() {
  return \Drupal::currentUser();
}

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