[symfony-users] Re: Required fields i18n

2009-10-23 Thread michael.pie...@googlemail.com
I solved it this way: In your form configure method (i18n form): /* set required if object culture is 'en' */ $required = ($this-getObject()-getCulture() === 'en') ? true : false; $this-setValidators(array( 'name'= new sfValidatorString(array('required' = $required)), )); Hope this

[symfony-users] Re: Required fields i18n

2009-10-23 Thread Alexandre SALOME
Well, i think you mean : fill all the required, or none ? Because this is good for en, but what if 2 objects of the same class does not fill the same language... 2009/10/23 michael.pie...@googlemail.com michael.pie...@googlemail.com I solved it this way: In your form configure method (i18n

[symfony-users] Re: Required fields i18n

2009-10-23 Thread michael.pie...@googlemail.com
I'm not sure i understand you ... This works for me when i want the 'name' field in my i18n form to be 'required', but only for the 'en' language (in this example). So if i have 3 cultures and submit the main form, i get an error beside the empty 'name' widget, but only for the specified

[symfony-users] Re: Required fields i18n

2009-10-23 Thread HAUSa
Exactly. I want to be 100% sure that one language is completed. But the user may choose for himself if he wants to make his content available in other languages. On 23 okt, 14:44, michael.pie...@googlemail.com michael.pie...@googlemail.com wrote: I'm not sure i understand you ... This works

[symfony-users] Re: Required fields i18n

2009-10-23 Thread michael.pie...@googlemail.com
That I'm not sure i understand you was for Alexandre ... @HAUSa: this was the same problem i had and the code i wrote in my first post did it for me ... Michael On 23 Okt., 15:04, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: Exactly. I want to be 100% sure that one language is

[symfony-users] Re: Required fields i18n

2009-10-23 Thread Alexandre SALOME
OK sorry, I thought you wanted something more specific : one language form must be filled. english, or spanish or french. But if the only required form is english... you're done ;) 2009/10/23 michael.pie...@googlemail.com michael.pie...@googlemail.com That I'm not sure i understand you was