You _can_ do whatever you like. It really doesn't matter. However, generally
speaking models, views and controllers should be equally sized with
appropriate content.

What I usually use to judge (btw, no one says I'm right) is this:

   - I start with the view. Generally they shouldn't have much logic in
   them. Just a for each loop to spit out data.
   - I use controllers as a port to the views. So if data isn't being
   processed to be "displayed", it doesn't belong in the controller.
   - Models are validation generally. If I have a lot of repeatable data
   processes that dump data...I usually stick them in here too.



On Dec 13, 2007 6:00 PM, Steveston <[EMAIL PROTECTED]> wrote:

>
>  Shall I put more database operations in model or in controller. For
> example, suppose I need to get all students (name and ID) who
> registers in course 101 but did not pay mandatory lab fee. It requires
> at least three tables, students, course_registration, and
> lab_fee_payment. I can do this in controller and I can also put this
> in a model.
>
>  In other words, you can put most db operation codes in controller
> (you will have a big controller but a small model, usually just a few
> lines); or you can put all those db operations in model, and call
> thoese operations from controller. in this case, the model tends to be
> bigger, and controller tends to be just a bunch of if/else, for/while
> statements (the main responsibility for the controller is to direct
> traffic to model and let model do the job )
>
>   Which one do you think is the prefereed way?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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