user_format_name

user_format_name(AccountInterface $account)

Format a username.

@todo Remove usage in https://www.drupal.org/node/2311219.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account object for the user whose name is to be formatted.

Return value

string An unsanitized string with the username to display.

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\Session\AccountInterface::getDisplayName().

File

core/modules/user/user.module, line 425
Enables the user registration and login system.

Code

function user_format_name(AccountInterface $account) {
  return $account->getDisplayName();
}
doc_Drupal
2016-10-29 09:53:15
Comments
Leave a Comment

Please login to continue.