I have an array with 38 records.
After iterating over the first 10 I want it to start on a new column.
This is very simple and an example is below, however, I need to add in HTML which makes it difficult:
@for($i = 0; $i < count($records); $i++)
@if($i % 10 == 0)
//start new column
@endif
<li><a href="#">{{ $records[$i]['name'] }}</a></li>
@endfor
What the HTML looks like without looping and what it should look like after looping properly:
<li class="col-sm-3">
<li class="dropdown-header">
Record Set
</li>
<li><a href="#">Record Name</a></li>
<li><a href="#">Record Name</a></li>
<li><a href="#">Record Name</a></li>
</li>
Problem is, after 10 records I need it to break out of col-sm-3 and start a new col-sm-3 without the dropdown-header but with each iteration's record name.
How can this be done? Please ask questions if clarification is needed.