Hi Sheraz,

   Thanks for your advise, it is helpful!!

   In my situation, the second validator is custom one, so I have to
redefine the call as you proposed.

   Ok, thank you again.

JoJo

2010/1/20 Sheraz Sharif <[email protected]>

> Maybe you can use the sfValidatorAnd?
>
>
> http://www.symfony-project.org/forms/1_4/en/B-Validators#chapter_b_sub_sfvalidatorand
>
> On Wed, Jan 20, 2010 at 10:39 AM, jojo <[email protected]> wrote:
>
>> Hello everybody,
>>
>>
>> I would like to ask my customer validator when the default one returns
>> true (so no call if default one returns false)
>>
>> For example:
>>
>> //The default validator:
>> $this->validatorSchema['link'] = new sfValidatorUrl();
>>
>> //I added customer validator:
>> $this->validatorSchema->setPostValidator(
>>            new sfValidatorCallback(array('callback' => array($this,
>> 'checkLink')))
>> );
>>
>> // Customer validator definition
>> public function checkLink($validator, $values){
>>       // some code here
>> }
>>
>> What I would like to do is that if default validator returns false, I
>> wont call my customer validator.
>>
>> Can anyone help me?
>>
>> Thanks a lot.
>>
>> JoJo
>>
>> --
>> 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]<symfony-users%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en.
>>
>>
>>
>>
>
>
> --
> Sheraz Sharif
> [email protected]
> http://sherazsharif.com
>
> --
> 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]<symfony-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
--
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.

Reply via email to