On Tue, Dec 23, 2008 at 11:01 PM, mathie <trung...@gmail.com> 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?
>

Ask yourself the question - are you just going to display it OR you
will be doing something more (eg: save for a report) with it?


Display only == View

HTH

Tarique


-- 
=============================================================
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=============================================================

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to