2015-02-05 2 views
0

XML 피드에서 속성을 가져오고 싶습니다. 만일 경우 : 유체의 배열을 디버깅, 나는 이름 @attributes와 배열로 속성을 볼 수 있습니다TYPO3 유체 get @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) 

그러나이 구문을 사용하여 URL을 읽을 수 없습니다 :

[email protected] 

아마도 @ 기호 일 것입니다. Viewhelper (어쩌면 VHS) 또는 데이터를 읽는 데 사용할 수있는 것이 있습니까?

+1

... ... – Christoph

+0

이것은 SimpleXMLElement입니다. ' {enclosure. @ attributes}'도 다음을 참조하십시오 : http://forum.typo3.org/index.php?t=msg&goto=660534& . 컨트롤러가있는 경우 표준 SimpleXMLElement 함수를 사용하여 템플릿에 실제 배열 또는 필요한 값만 제공해야합니다. – nbar

+0

내 방법은 언급 한 대체 솔루션 @nbar가 더 깨끗한 것 같아요. – Christoph

답변

0

감사합니다. Christoph. 이 솔루션의 작동 방식 :

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