I search everywhere in the web but i dont find any solution.
I make an entity query for get some nodes. I pass the nodes to my template. In there nodes, i have an image field. So my questions is, can i specify an image style in this case ?
Controllers.php
$query = $this->entity_query->get('node');
$query->condition('type', 'foo');
$nids = $query->execute();
$foos = $this->entity_manager->getStorage('node')->loadMultiple($nids);
return array(
'#theme' => 'foo',
'#foos' => $foos
);
template.html.twig
{% for foo in foos %}
<img src='{{ file_url(foo.field_picture.entity.uri.value) }}'>
{% endfor %}