for循环 显示循环次数好弄 ,但这个foreach就不知道怎么弄了
序号
名称
数量
金额
此处如问题所问显示循环次数,每次+1
{$goods.goods_name}
{$goods.goods_number}
{$goods.subtotal}
效果差不多就是这样:
序号 名称 数量 金额
1 aa 12 52.00
2 bb 10 26.00
3 cc 5 99.00
4 dd 16 88.00
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
{foreach name=xxx}
$smarty.foreach.xxx.index
这种问题 很容易 百度 到吧 ?