【发布时间】:2020-05-23 14:56:58
【问题描述】:
我正在研究 laravel,我需要使用类似 @foreach() 指令在 laravel Blade 中使用 do While 循环。 我已经在使用
@php
$count=0;
do {
$count++
@endphp
<span> my all html here </span>
@php
} while($count <10);
@endphp
请告诉我使用 DO-While 的最佳方式而不是 foreach 或 while。谢谢
【问题讨论】:
-
您向我们展示的内容有什么问题?它不工作吗?它做错了吗?
-
@for($count = 1; $count <= 10; $count++)或@foreach(range(1, 10) as $count) -
为此使用 do-while 的最佳方法是不使用 do-while。不需要。