Like other people said, if you already have data set, count($comments) would be good.

If you are only interested to the count and not having the data, then I would do

$num_comment = $this->Comment->findCount(array("post_id" => $post_id));
$this->set("num_comment", $num_comment);

For the formatting functions,
if you are formatting data to fit the database format, then I would put them in a component.
If you are are formatting data for the view, I would put in a helper.
I think that is the difference and the purpose.
Although, I feel that there should be one more thing that combines these two, but that's off topic.

Sohei

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to