I have a foreach loop where I need to insert a div every nth object.
@if(count($articles))
@foreach($articles as $article)
@if(this is the nth object)
<div class="row margin-b-2">
@endif
<div class="col-sm-4">
<a style="background-color: " href=""></a>
</div>
@if(this is the nth object)
</div>
@endif
@endforeach
@endif
this is the bare bones of what I am trying to do.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire