Example #1
0
$N = count($reviews);
$maxLeftColumn = ceil($N / 2);
//how many to store in left column, which takes priority
$leftColumnCount = 0;
$rightColumnCount = 0;
?>
			<div class="column">
				<?php 
foreach ($reviews as $review) {
    $reviewRating = $review['rating'];
    $reviewText = $review['review'];
    $reviewFirstName = $review['firstname'];
    $reviewLastName = $review['lastname'];
    $reviewAuthor = $reviewFirstName . " " . $reviewLastName;
    $reviewPublication = $review['publication'];
    $reviewRatingGif = $modelMethods->reviewGif($reviewRating);
    if ($leftColumnCount < $maxLeftColumn) {
        //how many to store in left column
        ?>
				 <div class="review">
 					<p class="quote">
 						<img src= <?php 
        echo $reviewRatingGif;
        ?>
 alt= <?php 
        echo $reviewRating;
        ?>
/>
 						<q><?php 
        echo $reviewText;
        ?>