W3cubDocs

/Drupal 8

protected function FormBase::currentUser

protected FormBase::currentUser()

Gets the current user.

Return value

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

File

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

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormBase.php/function/FormBase::currentUser/8.1.x