8.5.x FormBase.php FormBase::currentUser()
8.0.x FormBase.php FormBase::currentUser()
8.1.x FormBase.php FormBase::currentUser()
8.2.x FormBase.php FormBase::currentUser()
8.3.x FormBase.php FormBase::currentUser()
8.4.x FormBase.php FormBase::currentUser()
8.6.x FormBase.php FormBase::currentUser()

Gets the current user.

Return value

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

13 calls to FormBase::currentUser()
AccountForm::form in core/modules/user/src/AccountForm.php
Gets the actual form array to be built.
BlockContentForm::form in core/modules/block_content/src/BlockContentForm.php
Gets the actual form array to be built.
BookOutlineForm::form in core/modules/book/src/Form/BookOutlineForm.php
Gets the actual form array to be built.
EntityModerationForm::buildForm in core/modules/content_moderation/src/Form/EntityModerationForm.php
Form constructor.
MessageForm::form in core/modules/contact/src/MessageForm.php
Gets the actual form array to be built.

... See full list

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();
}