Looks nice. I just prefer to take variables out of strings:
<?php foreach($books as $book): ?>
<div class="book">
<h4><?php echo $html->link($book['Book']['title'],
'view/' . $book['Book']['id']); ?></h4>
<p><?php echo $book['Book']['short_description'] ?></p>
</div>
<?php endforeach; ?>
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de Tijs Teulings
Enviado el: Viernes, 08 de Diciembre de 2006 10:08 a.m.
Para: [email protected]
Asunto: Re: Passing data to the view in a nice way?
I haven't run into a query yet where a simple foreach loop did not suffice;
are you doing something similar like this in your views?:
<?php foreach($books as $book): ?>
<div class="book">
<h4><?php echo $html->link($book['Book']['title'],
"view/{$book['Book']['id']}"); ?></h4>
<p><?php echo $book['Book']['short_description'] ?></p>
</div>
<?php endforeach; ?>
where my controller did:
set('books', $this->Book->findAll());
That's not too bad is it?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---