I do a similar thing in my AppModel. Look at the Model methods and also pr($this) in your AppModel to see what data you can access, etc. You can get all the field names and types easily using $this->schema() or $this->getColumnTypes().
Cheers, Adam On Nov 25, 2:34 am, Ernesto <[EMAIL PROTECTED]> wrote: > Hello. > > My goal is to provide a default formatting, based on MySQL's fields > types because > the webapp i'm baking uses some differrent field format than MySQL. > For ex: > - Dates are "dd/mm/yyyy" instead of MySQL's "yyyy-mm-dd" > - Floating point numbers uses commas instead of dots as decimal > separator > > I've made a FieldFormatHelper, called in every controller's > beforeValidate() function but that's not very handy because i need a > rule for every field. > > So i tried to process fields in AppModel's beforeValidate() but i > can't get the code to work. > > How can i do? > Is there a better way? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
