开发者

how compare two validators for one field?

I must use two validator for one fields:

$this->setVa开发者_运维问答lidator('number', new sfValidatorDoctrineUnique(
                    array('model' => 'Data', 'column' => 'number')               )
          );

$this->setValidator('number', new sfValidatorString(array('required' => true)));

now working only secons validators. how can i compare this?


You can use:

$this->validatorSchema['number'] = new sfValidatorAnd(array(
  new sfValidatorDoctrineUnique(array('model' => 'Data', 'column' => 'number'),
  new sfValidatorString(array('required' => true)),
));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜