Hi, I've got a Frames Model. Every frame has a (double) width and a (double) height. The standard unit for the values is centimeter.
A User has chosen that he/she prefers: inches for fields where a length-value is required I'm doing conversion from the standard unit (centimeters) to the unit preferred by the user every time when I'm getting data from the Model through the controller into the view AND vice versa when I get input data from the user before saving it into the table. 1. In which layer should I do the conversion? I thought it should be placed within the model in beforeSave() / beforeValidate() and afterFind(). But conversion is not that easy (maybe in this particular case) and I really would like to have something like complex UnitConversionComponent but using components make no sense in a model at all... 2. Where can I correct input errors? If a user types "87EUR" which is invalid and only "EUR 82.2" would be valid. Where can I correct the "mistake"? I know that I can do it in beforeValidate() ...but how can I send the now valid value "EUR 82.2" back to the view (if there were more invalid values that couldnt be corrected) ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---