On 9/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Sorry to once again start another new thread but im having trouble
> finding where i should put functions to which i would use inside the
> view.
>
> I wish to create a countComment($post_id) function that will do... well
> what it says on the tin and return a count of the comments for the
> $post_id given.
>
> Would this function go in the model? and if so how do a reference it in
> the view?
Having seen the light two days ago, I would advise to put the
functionality in the model. Then, in your controller you would grab
the results of this function and then use a $this->set('foo', $bar)
type of assignment ot make it available in the view.
> I also have a number of formatting functions i will be creating that
> will need to take data, change it then return it back.
>
> Im assume these should go in the model as well? or should i be creating
> these as components?
>
If you are going to take the same data and display it multiple ways in
the view, then I think a component would be the best way to go. I'm
sure other people will correct me if I'm wrong.
--
Chris Hartjes
"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---