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)),
));
精彩评论