Im trying to write a Comment system to extend the simple blog tutorial
on CakePHP website and im currently stuck on how i would be able to
pass a few simple things between my comments_controller and my
posts_controller.
Am i right in thinking that the models/comment.php is the place where i
should have functions that use the data taken from the controllers and
edit them for use in my views?
I'll give you an example, im currently trying to do a simple count
function on my comments, which will be displayed on the posts page just
after the title.
I have created a commentCount function in models/comment.php which has
the following
function commentCount($id=NULL)
{
if($id)
{
return
$this->findCount(array("post_id"=>"$id"));
}
}
Now how do i go about calling that function in my posts/view.thtml?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---