0
我有这样的一个xml:使用如何访问Twig(Symfony)中特定节点的XML属性?
item.domain.currentPrice
<item>
<domain>
<currentPrice currency="EUR">17.9</currentPrice>
</domain>
</item>
我可以呈现在嫩枝17.9的价值,但我怎么能访问属性“货币”来呈现呢?
item.domain.currentPrice['currency']
不起作用。然后我得到:
Key "curreny" in object (with ArrayAccess) of type "SimpleXMLElement" does not exist
谁能帮我?