IMO, regarding your comment on how to display negative numbers, or how to
display any number for that matter, is the sole responsibility of the view.
The Model should be independent of how data is to be displayed. 

What if the View renders the model as a PDF document? What if the view
renders it as an XML? There are different ways on how to display the color
red depending on the end display engine, and models should know nothing
about display.

The same way, if an error message should contain special formatting aiming
for a rendering engine (HTML for that matter,) it is the view responsibility
on properly formatting it to display it. Now you can of course set an
intermediate language as part of the error message in the model, and then
properly render that error message on the view depending on the format the
view should output.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Domingo, 22 de Abril de 2007 02:52 p.m.
Para: Cake PHP
Asunto: Re: where to change or add 'This field cannot be left blank' such
validate msg?

One of the classic MVC debates relates to the display of negative
numbers which, in typical accounting applications are displayed in
red.  But which tier is responsible for deciding that?  There are good
arguments on both sides (especially when you consider desktop
applications), and no one right answer.


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to