16
December
Following code can be used to get user picture or image by loading user data in Drupal 8
$user = \Drupal\user\Entity\User::load($uid); $imgpath = $user->get('user_picture')->entity->uri->value; if(!empty($imgpath)){ $user_pic = file_create_url($picurl); }
© 2023.ZedAngle. All Rights Reserved.