By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-beta16
Issue links:
Description:
User::getUsername() is deprecated, use User::getAccountName() or User::getDisplayName() instead.
Case: You want to fetch the data stored in the database:
$logger->log('%user logged in', ['%user' => $user->getAccountName()]);
Case: You want to show a username
$user->getDisplayName();
Impacts:
Module developers
Comments
I've tried to use it one of
I've tried to use it one of my template files but it wouldn't work.
{{ 'Welcome, @username'|t({ '@username': User::getDisplayName() }) }}neither does
{{ 'Welcome, @username'|t({ '@username': user.name }) }}Any tips?