ControllerBase::currentUser

protected ControllerBase::currentUser()

Returns the current user.

Return value

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

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 262

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function currentUser() {
  if (!$this->currentUser) {
    $this->currentUser = $this->container()->get('current_user');
  }
  return $this->currentUser;
}
doc_Drupal
2016-10-29 08:58:56
Comments
Leave a Comment

Please login to continue.