Skip to content

Instantly share code, notes, and snippets.

@GuiSevero
Last active August 29, 2015 14:01
Show Gist options
  • Save GuiSevero/0ce7912712a89b581a70 to your computer and use it in GitHub Desktop.
Save GuiSevero/0ce7912712a89b581a70 to your computer and use it in GitHub Desktop.
grid php
<?php $prjs = Projeto::$momentos; $length = count($prjs) ?>
<?php for($i=0 ; $i < $length; $i+=3): ?>
<div class="row">
<?php if($i < $length):?>
<div class="span4 view"><?php echo CHtml::link( $prjs[$i], array("/projeto/index",'situacao'=>$i) )?></div>
<?php endif;?>
<?php if($i+1 < $length):?>
<div class="span4 view"><?php echo CHtml::link( $prjs[$i+1], array("/projeto/index",'situacao'=>$i+1) )?></div>
<?php endif;?>
<?php if($i+2 < $length):?>
<div class="span4 view"><?php echo CHtml::link( $prjs[$i+2], array("/projeto/index",'situacao'=>$i+2) )?></div>
<?php endif;?>
</div>
<?php endfor;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment