我有一個數組:如何在smarty中打印數組?
$team_details = Array ([id] => 1 [name] => doge_finder [total_rewards] => 52.00524500 [desciption] => team is only of doge miners [created_by] => 20);
/* assigning to a smarty template */
$smarty->assign("team_record", $team_details);
$smarty->display($tpl);
在模板文件:
{foreach from= $team_record key=team item=trecord}
{$trecord[$key].name}
{/foreach}
在結果輸出必須是「doge_finder」,但我得到的陣列,即每個記錄的首字符。 「1 d 5 t 2」
我該如何解決這個問題?
心不是牛逼他的{$ team_record.name}'夠了嗎? –