我想要像这样的表中有动态的行数。
number name
1 Devy
这是我的 Blade 模板。
<thead>
<th>number</th>
<th>name</th>
</thead>
<tbody>
@foreach ($aaa as $value)
<tr>
<td></td>
<td>{{$value->name}}</td>
</tr>
@endforeach
</tbody>
我怎么做?
Try $loop->iteration
多变的。
`
<thead>
<th>number</th>
<th>name</th>
</thead>
<tbody>
@foreach ($aaa as $value)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$value}}</td>
</tr>
@endforeach
</tbody>
`
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)