我好心寻求帮助,这样的细枝模板中显示动态图像URL:如何使用Twig显示动态图像URL?
// non-working pseudocode, myImageFilename contains image filename
{% image '@AppBundle/Resources/public/images/' + myImageFilename %}
<img src="{{ asset_url }}" />
{% endimage %}
但枝条只允许静态的文件名,这样(从资料为准)。我已经试过concatinator ~
像
{% image '@AppBundle/Resources/public/images/' ~ myImageFilename %}
,但它也不起作用,
{% image '@AppBundle/Resources/public/images/example.jpg' %}
<img src="{{ asset_url }}" alt="Example"/>
{% endimage %}
是否有使用动态图像的URL与此嫩枝图像逻辑成为了可能?