TYPO3流体得到@attributes

时间:2015-02-05 09:17:55

标签: typo3 fluid

我想从xml提要中获取属性。 如果我f:调试流体中的数组,我可以看到属性为一个名为@attributes的数组:

array(6 items)
  title => 'Test Title'
  enclosure => array(1 item)
  @attributes => array(3 items)
     url => 'http://www.example.com/test.jpg' (55 chars)
     length => '83423' (5 chars)
     type => 'image/jpeg' (10 chars)

但是无法使用以下语法读取网址:

enclosure.@attributes.url

也许是@符号。 是否有Viewhelper(可能是VHS)或我可以用来读取数据的东西?

1 个答案:

答案 0 :(得分:0)

谢谢Christoph。该解决方案有效:

<f:for each="{rss_news.enclosure}" as="item">
     <img src="{item.url}" alt="">
</f:for>