In my theme, I wanted to output an img tag with the image’s src attribute. I found that the way to do that is (example):
So I have installed Twig Xdebug (https://www.drupal.org/project/twig_xdebug) and looking at the debugger, neither the image (field_example_image) nor its array (field_example_image[‘#items’]) have a member called ‘entity’. So where does the ‘entity’ coming from?
I looked at the variables in kint output as well, but there’s nowhere in sight a variable called ‘entity’. So how can someone ‘figure out’ that there is a variable called ‘entity’ that needs to be used in order to figure out the src of an image?
Sure, I can copy paste this into my twig template and call it a day (after all it does work), but I’d like to understand where do you find this ‘entity’?
(using Drupal 8.6.x)