0

誰でもこれが理由を教えてもらえますか:

{% for key, logo in it %}
{% set imageUrl = "bundles/acme/img/it/"~logo %}
<li><img src="{{ get_image(imageUrl) }}" alt="{{ key }}"0/></li>
{% endfor %}

これを引き起こします:

An exception has been thrown during the compilation of a template ("Attribute "value" does not exist for Node "Twig_Node_Expression_Name".")

アドバイスがあればthx

4

1 に答える 1

1

代わりにメソッドを使用してasset()ください...

{% for key, logo in it %}
   {% set imageUrl = "bundles/acme/img/it/"~logo %}
   <li><img src="{{ asset(imageUrl) }}" alt="{{ key }}"/></li>
{% endfor %}
于 2013-07-04T13:25:38.610 に答える