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
誰能幫我?