2010/2/19 NOOVEO - Christophe Brun <c.b...@nooveo.fr>: > I'm not sure since I'm still a beginner on symfony and doctrine, but if your > variable is a Doctrine_Collection, I would try something like : > > $it = $amigos_miembro->getIterator(); > while($it->next()) { > do_stuff(); > } > >
I'm wondering why you are trying to accomplish this with doctrine. I'm using this solution. For me such code makes more sens than hocus pocus with dotrine. <table> <tbody> <?php $x = 1 ?> <tr> <?php foreach ($Photos->getResults() as $Photo): ?> <td> <?php include_partial('photo/show', array('Photo' => $Photo, 'gallery_id' => $Photo->getGalleryId(), 'username' => $username, 'owner' => $owner, 'format' => 'short')) ?> </td> <?php if ($x == $max_x): ?> </tr> <?php $x = 1 ?> <tr> <?php else: ?> <?php $x++ ?> <?php endif; ?> <?php endforeach; ?> <?php while ($x <= $max_x): ?> <td></td> <?php $x++ ?> <?php endwhile; ?> </tr> </tbody> </table> Regards, Michal -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.