Sto ottenendo un json da un'api, come stampare il json utilizzando Smarty.Come stampare un json in Smarty
formato JSON
[
{
"first_name": "jinu",
"last_name": "mk",
"loginid": "[email protected]",
"timezone": "5.5",
"team_id": "c964ef415f157ddd99173f5b481ee1e3",
"user_type": 1,
"last_login_date": null
},
{
"first_name": "avatar second",
"last_name": "test",
"loginid": "[email protected]",
"timezone": "5.5",
"team_id": "ec40f5feda8643135bc20be44f897b03",
"user_type": "3",
"last_login_date": null
},
{
"first_name": "avatar testing admin",
"last_name": "amt 1",
"loginid": "[email protected]",
"timezone": "5.5",
"team_id": "ec40f5feda8643135bc20be44f897b03",
"user_type": 1,
"last_login_date": null
}
]
devo stanco seguente foreach ma la sua non stampare nulla.
{foreach from=$games item=foo}
<li>{$foo.first_name}</li>
{/foreach}
Si prega di aiutarmi a risolvere questo problema. Grazie
Grazie mille per il vostro aiuto. Mi ha davvero aiutato. – Dibish
@Dibish Prego –