Tuesday, November 27, 2012

combine multiple foreach statements

hi guys,... can anyone help please,... 
I have 2 foreach statements in my view,... 

how can I combine two or more foreach statements to one,... ? 

  <?php $i = 0 ?>
  <?php foreach($friends_photo_comments as $photo_comment): ?>
[code]....
   <?php $i++ ?>
  <?php endforeach ?>

   <?php $i = 0 ?>
<?php foreach($friends_blog_comments as $blog_comment): ?>
[code]....
<?php $i++ ?>
  <?php endforeach ?>

thanks in advance, 
chris

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: