Depends. If you can do it in DB without performance loss, that's the
best way. If not, view is good enough. I tend to do as much as
possible in the database, because the damn thing is optimized to work
with (large) sets of data. But in the end, if that's not an option for
you, whatever gets the job done... :-)

On Dec 23, 6:31 pm, mathie <[email protected]> wrote:
> Hello,
>
> This is a design question on MVC separation. Say I need to display a
> table with many rows, then a total and an average row. Should the
> calculation of this total/average be done in the view (in the loop) or
> in the controller (after getting the rows from DB)?
>
> A related question. For an invoice: $amount = $price * $quantity;
> Could that be in the view or not?
>
> Basically I guess my question: what is considered view logic?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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