Answers for "load user by name in Drupal 8"

0

drupal 8 get user

$current_user = \Drupal::currentUser();
$user = \Drupal\user\Entity\User::load($current_user->id());

// or just
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
Posted by: Guest on October-04-2020
0

drupal 8 load user by name

$user = user_load_by_name('username');
Posted by: Guest on October-07-2021

Code answers related to "load user by name in Drupal 8"

Browse Popular Code Answers by Language