Ummm it does give allot of overhead to request all comments and only
display a few... especially on a high traffic site.

On Feb 9, 8:00 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> > I want to return only a number of comments (that is defined in
> > "visiblecomments") in every story.
>
> This seems like an odd way of doing it, as you'd be able to specify
> how many comments to retrieve, but not which ones... but yes, it's
> certainly possible.
>
> In your story controller, if your use of findAll is set to recurse, it
> will automatically pull out all of the comments relating to that
> story. Presumably, you're using a foreach on this information in the
> view, so you could just limit it to stop once the visiblecomments
> value has been reached.
>
> There are more advanced ways of doing it, such as overriding afterFind
> in the stories model to append the right number of comments, but it's
> probably easier to do it the first way instead. :)
>
> Hope that helps,
> Zoe.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to