Route title callback.
\Drupal\user\UserInterface $user: The user account.
string|array The user account name as a render array or an empty string if $user is NULL.
public function userTitle(?UserInterface $user = NULL) { return $user ? [ '#markup' => $user->getDisplayName(), '#allowed_tags' => Xss::getHtmlTagList(), ] : ''; }