title: Sonata media gallery
body: <p>I try to make a web site with Symfony. So I installed SonataAdminBundle and SonataMediaBundle.</p>
  
  <p>And I have a question about Sonata media.
  I created a gallery with a lots of image media in it and I don't know how I can access it from my Controller.</p>
  
  <p><em>How can I get my media (image) contained in my gallery for show them in my template?</em></p>
  
  <p>thx for help !</p>
  
  <p>EDIT:
  I solved my problem !</p>
  
  <p>So in my template I do:</p>
  
  <pre><code>{% for img in MyEntity.gallery.galleryHasMedias %}
      &lt;img src={% path img.media, 'reference'%}&gt;
  {% endfor %}
  </code></pre>