1

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

adamS
  • 592
  • 8
  • 14
  • Relevant: http://stackoverflow.com/questions/9500573/path-of-assets-in-css-files-in-symfony2 – zerkms Mar 24 '14 at 02:23

3 Answers3

1

found my answer here. I hope this helps someone else in the future

https://github.com/symfony/AsseticBundle/issues/41

adamS
  • 592
  • 8
  • 14
0

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

Nicolas Talichet
  • 309
  • 3
  • 16
0

As Tali says, you should execute the command "assetic:dump" to dump your bundle assets in web folder.

adridev
  • 1,150
  • 10
  • 15