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

Breadcrumb

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

function ToolbarLinkBuilder::renderDisplayName

Lazy builder callback for rendering the username.

Return value

array A renderable array as expected by the renderer service.

File

core/modules/user/src/ToolbarLinkBuilder.php, line 81

Class

ToolbarLinkBuilder
ToolbarLinkBuilder fills out the placeholders generated in user_toolbar().

Namespace

Drupal\user

Code

public function renderDisplayName() {
    return [
        '#plain_text' => $this->account
            ->getDisplayName(),
    ];
}

API Navigation

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