Sonata Media Bundle : acces media url
问题 I am using sonata media bundle. and I was wondering how can I access the media url in twig. I just want the url, I do not need to show the media. Any suggestions? 回答1: You have to use the path media helper: {% path media, 'small' %} In the above code, media is an instance of the media entity, and small is the chosen format. http://sonata-project.org/bundles/media/master/doc/reference/helpers.html#twig-usage 回答2: But if you do not want to render the media right there and just store the url in