Answers for "drupal 8 get current user programmatically"

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

Code answers related to "drupal 8 get current user programmatically"

Browse Popular Code Answers by Language