输入:
{% for car in closet %}
<img src="{{ asset('images/') }}{{ car.photo1 }}" />
{% endfor %}
html输出:
<img src="/images/1bb8cee7cd58403ba84daee67d82fa869ec6052d.jpeg" />
如何从AvalancheImagineBundle中应用此功能:
<img src="{{ '/relative/path/to/image.jpg' | apply_filter('my_thumb') }}" />
我无法解决这个问题,因为路径和文件名是分开的
答案 0 :(得分:3)
简单地:
<img src="{{ (asset('images/') ~ car.photo1) | apply_filter('my_thumb') }}" />