Reputation: 600
I'm new to Symfony and I'm trying to include and image (stored in the bundle Resources/public/images dir) in a twig template. When I render the page however the img tag has a non existent src path. I'm not sure what is going on, any advice would be appreciated greatly.
My Twig File
{% image '@XYZTestBundle/Resources/public/images/bananas.jpg' %}
<img src="{{ asset_url }}" alt="Symfony!" />
{% endimage %}
The rendered image tag
<img src="/myproject/web/images/5fcddd8.jpg" alt="Symfony!">
There are no files in the /myproject/web/images/ directory
Upvotes: 1
Views: 8313
Reputation: 1170
As Tali says, you should execute the command "assetic:dump" to dump your bundle assets in web folder.
Upvotes: 0
Reputation: 311
have you try the command php app/console assetic:dump or php app/console assets:install ?
otherwise I think this link can help you : http://symfony.com/doc/current/cookbook/assetic/asset_management.html
Upvotes: 0
Reputation: 600
found my answer here. I hope this helps someone else in the future
https://github.com/symfony/AsseticBundle/issues/41
Upvotes: 1