用一段section模拟 {section name=loop loop=$count} id: {$smarty.section.loop.index} {/section} 给count赋个值 $smarty->assign("count", 5);