Answers for "drupal 8 load media programmatically"

0

drupal 8 get file url from target id

use DrupalmediaEntityMedia;
use DrupalfileEntityFile;

$media = Media::load($mid);
$fid = $media->field_media_image->target_id;
$file = File::load($fid);

$url = $file->url();
Posted by: Guest on November-16-2020

Code answers related to "drupal 8 load media programmatically"

Browse Popular Code Answers by Language