drupal 8 get media image uri
$image_url = $media->field_media_image->entity->getFileUri();
file_create_url($image_url);
drupal 8 get media image uri
$image_url = $media->field_media_image->entity->getFileUri();
file_create_url($image_url);
drupal 8 get file url from target id
use Drupal\media\Entity\Media;
use Drupal\file\Entity\File;
$media = Media::load($mid);
$fid = $media->field_media_image->target_id;
$file = File::load($fid);
$url = $file->url();
drupal 8 get media image uri
$image_url = $media->field_media_image->entity->getFileUri();
file_create_url($image_url);
drupal 8 get file url from target id
use Drupal\media\Entity\Media;
use Drupal\file\Entity\File;
$media = Media::load($mid);
$fid = $media->field_media_image->target_id;
$file = File::load($fid);
$url = $file->url();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us