[symfony-users] Re: Trying to replace the default 'Required' message

2010-08-26 Thread Javier Garcia
Thanks!, i would swear i tried it.. On Aug 26, 12:53 am, Michał Piotrowski mkkp...@gmail.com wrote: 2010/8/24 Javier Garcia tirengar...@gmail.com:  Sorry, could you paste the entire validator? I dont understand..     $this-validatorSchema['email_address'] = new sfValidatorAnd(array(      

[symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Thor
you have to pass it as an required field in an array, given as second parameter of the validator new sfvalidatorsomething(array(...),array('invalid'='invalid message','required'='required message')); On 24 Ago, 13:05, Javier Garcia tirengar...@gmail.com wrote:   Sorry, could you paste the

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Javier Garcia
I tried this: $this-setValidator('email', new sfValidatorAnd(array( new sfValidatorEmail(array('required' = true, 'trim' = true)), new sfValidatorString(array('required' = true, 'max_length' = 80), array('required' = 'THIS FIELD IS REQUIRED')), new

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Gustavo Adrian
Maybe because first it's the sfValidatorEmail that throws the required error? Although, if you want to change the required field message to every validator, you could do this: sfValidatorBase::setDefaultMessage( 'required', 'My required message' ); On Tue, Aug 24, 2010 at 1:53 PM, Javier Garcia

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Gustavo Adrian
Or course, that line could be on the BaseForm or even in the application configuration class so every form could use that default message. The same applies to the 'invalid' message. On Tue, Aug 24, 2010 at 2:26 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Maybe because first it's the

Re: [symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Javier Garcia
Thanks Gustavo, I think you mean this: $this-setValidator('email', new sfValidatorAnd(array( new sfValidatorEmail(array('required' = true, 'trim' = true), array('required' = 'THIS FIELD IS REQUIRED')), new sfValidatorString(array('required' = true, 'max_length' = 80)),

[symfony-users] Re: Trying to replace the default 'Required' message

2010-08-24 Thread Reo
Otherwise you could do, in your form class, #myformForm.class.php public function configure() { if (user_culture == fr) $this-widgetSchema-getFormFormatter()- setTranslationCatalogue('form_fr'); else if (user_culture == en) $this-widgetSchema-getFormFormatter()-