Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LinkBase.php

function LinkBase::currentUser

Gets the current active user.

@todo https://www.drupal.org/node/2105123 put this method in \Drupal\Core\Plugin\PluginBase instead.

Return value

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

1 call to LinkBase::currentUser()
LinkBase::checkUrlAccess in core/modules/views/src/Plugin/views/field/LinkBase.php
Checks access to the link route.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 111

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

protected function currentUser() {
    if (!$this->currentUser) {
        $this->currentUser = \Drupal::currentUser();
    }
    return $this->currentUser;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal