You can use variables in your view, just like you did, but my guess is
that $data is probably not an array. If you use a variable in a
foreach() loop that is not an array, that is the error you get.
Try doing:
pr($data);
in your controller to see what's inside.
You may also want to enclose your foreach in if statements like this:
<?php if (is_array($recentpapaers)) :?>
    <?php foreach ($recentpapers as $paper): ?>
    ....
    <?php endforeach; ?>
<?php else: ?>
     <p>No recent papers found.</p>
<?php endif; ?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to