function UserToolbarLinkBuilder::renderDisplayName

Lazy builder callback for rendering the username.

Return value

array A renderable array as expected by the renderer service.

File

core/modules/toolbar/src/UserToolbarLinkBuilder.php, line 81

Class

UserToolbarLinkBuilder
Fills out the placeholders generated in ToolbarHooks::userToolbar().

Namespace

Drupal\toolbar

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.