Created
February 15, 2017 10:55
-
-
Save mojoblanco/e1c98df1577d3215941e8ec9e656b614 to your computer and use it in GitHub Desktop.
Hack for looping with bootstrap rows and columns in ph[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php foreach (array_chunk($products, 3) as $row) : ?> | |
<div class="row"> | |
<?php foreach($row as $product): ?> | |
<div class="col-xs-12 col-sm-6 col-md-4"> | |
</div> | |
<?php endforeach; ?> | |
</div> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use
$products->chunk(3)
for objects