Am new to Smarty, i have a json array, my json array looks like following format
[
{
"id": "1",
"venue": "Test Venue1",
"game_date": "0000-00-00 00:00:00"
},
{
"id": "2",
"venue": "Test Venue 2",
"game_date": "0000-00-00 00:00:00"
}
]
Tried
{foreach from=$gamearray key=k item=v}
<li>{$k}: {$v}</li>
{/foreach}
Its display like this way
0: [
{
"id": "1",
"venue": "Test Venue1",
"game_date": "0000-00-00 00:00:00"
},
{
"id": "2",
"venue": "Test Venue 2",
"game_date": "0000-00-00 00:00:00"
}
]
I just want to show venue field only.
My php looks like this way
$stmt = $this->core->dbh->query($sql);
$listgame = $stmt->fetchAll(PDO::FETCH_OBJ);
$game_array = json_encode($listgame);
$app->render('base.tpl', array('gamearray'=>$game_array));
Please help me to solve this.. Thanks