I believe the correct way to have self-contained elements is for the
element to perform a requestAction to get the data it needs. If you
have
$data = $this->requestAction( '/books/toplist' );
in your element, and your /books/toplist action is something like
function toplist(){
return $this->Book->findAll( null, null, 'Book.rating DESC', 5 );
}
then your element can be rendered at will, and takes care of its own
data. The only tricky thing is that the requested action needs to
return the data, not $this->set() 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
-~----------~----~----~----~------~----~------~--~---