I'd like to retrieve the src URL of an image.
{% image "@AcmeMyBundle/Resources/public/image/myimage.jpg" %}
<img src={{ asset_url }}
{% endimage %}
How would I get the asset_url inside the controller?
e.g. http://example.com/images/c1ca79c_myimage.jpg
or even images/c1ca79c__myimage.jpg
I tried:
$this->container
->get('templating.helper.assets')
->getUrl('@AcmeMyBundle/Resources/public/image/myimage.jpg');
But this returns the string /@AcmeMyBundle/Resources/public/image/myimage.jpg and not a URL.
srcURL, or absolute path within a file system?