我有这样的图像:
{% image output='/images/foo.jpg' '@MyBundle/Resources/public/images/bar.jpg' %}
<img src="{{ asset(asset_url) }}" alt="Something">
{% endimage %}
现在我想获取图像尺寸并添加宽度和高度属性,例如
{% image output='/images/foo.jpg' '@MyBundle/Resources/public/images/bar.jpg' %}
<img src="{{ asset(asset_url) }}" alt="Something" width="{{ asset(asset_width) }}" height="{{ asset(asset_height) }}">
{% endimage %}
这可能吗?
此致