Skip to content

Instantly share code, notes, and snippets.

@mojoblanco
Created February 15, 2017 10:55
Show Gist options
  • Save mojoblanco/e1c98df1577d3215941e8ec9e656b614 to your computer and use it in GitHub Desktop.
Save mojoblanco/e1c98df1577d3215941e8ec9e656b614 to your computer and use it in GitHub Desktop.
Hack for looping with bootstrap rows and columns in ph[
<?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; ?>
@mojoblanco
Copy link
Author

mojoblanco commented Feb 15, 2017

use $products->chunk(3) for objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment