samedi 3 mars 2018

Foreach statement with making new rows in bootstrap

I have an array of 4 items and it comes with display order. I need to have a row for the first two items, (col-md-6) split and then the other 2 the same.

Although my code seems to have the first item by itself, the middle ones are correct, and last one is by itself.

@foreach ($reviews as $review)
    @if ($review->displayOrder == 1 || $review->displayOrder == 3)
        <div class="row">
    @endif


        <div class="col-sm-6">
            <div class="mb-30">
              <div class="ts4-text-cont">
                 - <strong><i></i></strong>
              </div>

            </div>
        </div>

    @if ($review->displayOrder == 1 || $review->displayOrder == 3)
        </div>
    @endif

@endforeach



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire