Re patter:
Thanks for the idea, but I'am trying it now in action now and it doesn't work
$vs = $this->form->getValidatorSchema();
echo get_class($vs); // prints sfValidatorSchema
var_dump($vs['column']);// prints NULL :(
$vs['column']->setOption('required', true); // ends with Fatal error
Fatal error: Call to a member function setOption() on a non-object
Re Kris Wallsmith:
Do you have an Idea how to use it? Any piece of code?
I tried to pass $this->validatorSchema as argument in sfValidatorCallback,
that I call as preValidator. I can use it, I can set option required to true,
but it seems, that it is too late to do it in this place.
In form:
myForm extends sfForm {
public function setUp() {
...
$this->validatorSchema['column']->setOption('required', false);
$this->setPreValidator(new
sfValidatorCallback(array('arguments'=>array('vs'=>$this->validatorSchema),
'callback'=>array($this, 'validateGroup')));
}
public function validateGroup($validator, $values, $args) {
// this pass without error, but column is not required
$args['vs']['column']->setOption('required', true);
return $values;
}
}
I tried also write custom GroupValidator which gets validatorSchema as option,
but result is the same as with callback validator.
For now I didn't find a way how to validate groups. The only way is to write a
callback for every group I have.
--
adrive
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---