Score:2

get the file URI of an ImageItem

in flag

How can I get the file URI of a Drupal\image\Plugin\Field\FieldType\ImageItem instance?

I get the field value with $node_entity->get('field_image')[0] but I don't know how to get the file URI.

Score:2
cn flag

You can use

$image_item->entity->getFileUri()
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.