But, the validator only converts back from the form.
I´m talking about fields that needs to be converted from the model to
the form and then back from the form to the model.
For instance:

I use a date in doctrine: 2005-08-07

When I need to convert it to a plain text date widget, the widget will
convert it here to 07/08/2005.

So the widget will convert it TO the form. As far as I know the
validator wont work at this point ( I might be wrong, of course ) .

But then I have a value '2005-08-07' that, when sent to the validator,
it gets converted to '07/08/2005'.

When the form is bound and the user had typed a not valid date, for
instance: "99/99/abcd". The form framework will get the "99/99/abcd"
value and send it to the widget. Then the widget wont be able to
convert it. Or even worse, when the user types a right value either,
but gets an error on another place of the form, the widget will try to
convert the righ value (for instance: "07/08/2005"). But the widget is
not expecting the value on this format, it is expecting on the
2005-07-07 format, so I will get an error even if the user types the
right format.

Please, help me to understand it better, I think I´m missing something here.

Bruno



2008/11/17 Fabien Potencier <[EMAIL PROTECTED]>:
>
> The conversion must be done by the validator, not the widget.
>
> Fabien
>
> --
> Fabien Potencier
> Sensio CEO - symfony lead developer
> sensiolabs.com | symfony-project.com | aide-de-camp.org
> Tél: +33 1 40 99 80 80
>
>
> Bruno Reis wrote:
>> Hi there,
>>
>> I´m facing a critical issue with the forms framework for some time
>> now. I have asked here more than once, but could get a good answer. At
>> least I could not understand if it is not a bug or what. Then, I
>> opened a bug:
>>
>> http://trac.symfony-project.org/ticket/4916#comment:1
>>
>> but it was marked invalid. I think I am not understanding how the
>> forms work. Please, if anyone can tell why the bug is invalid and what
>> is the point I cant get, tell me.
>>
>> thanks,
>> Bruno
>>
>> >
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to