Hi Yii expert,
I am using advanced yii2 template for developing REST Api. I have achieved basic usage like url router with CRUD and custom functions also. I got struck where i need to add attributes for xml element. For example
<person>
<firstname> yii </firstname>
<lastname> expert </lastname>
<dateofbirth date = "20" year = "1984">July</dateofbirth>
</person>
Is that possible to achieve?
I have already tried fields() method by overriding the dateofbirth… but i could not achieve this… any body have already done this kind of stuff in xml reponse for API.