Hello,
maybe I don't understood, but I think that the following snippet should
works fine :
$this->validatorSchema->setPostValidator(
new sfValidatorAnd(array(
new sfValidatorPropelUnique(array('model' => 'User', 'column' =>
array('username')), array('invalid' => 'User exists.')),
new sfValidatorPropelUnique(array('model' => 'User', 'column' =>
array('email')), array('invalid' => 'Email exists.')),
))
);
Take a look :
http://www.symfony-project.org/api/1_1/sfValidatorPropelUnique
2008/10/7 Rytis Daugirdas <[EMAIL PROTECTED]>
> Hello,
>
> What is currently the best way to change options and messages of post
> validators?
>
> $this->validatorSchema->setPostValidator(
> new sfValidatorAnd(array(
> new sfValidatorPropelUnique(array('model' => 'User', 'column' =>
> array('username'))),
> new sfValidatorPropelUnique(array('model' => 'User', 'column' =>
> array('email'))),
> ))
> );
>
> For example, how do I set the 'invalid' error message of the email
> validator? I can probably use a long chain of getters to do what I want such
> as...
>
> $validators = $this->validatorSchema->getPostValidator()->getValidators();
> $validators[1]->setMessage('invalid', 'Email exists.');
>
> ... but is there a cleaner way to do what I want?
>
> --
> Regards,
> Rytis
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---