Hi,
First time contributing here. :)
In sfForm, it's impossible right now to get to the cleaned values if
validation fails. This is good as default behavior, but it'd be useful
if one could override this when needed, and get the filtered values
even if some of them have errors. I might want to do something with
the cleaned values (eg: filter a list, or manually reconstruct state)
even if some of the fields are invalid.
This could be implemented as simply as keeping a copy of the last
cleaned values in sfValidatorSchema before throwing the $errorSchema,
or by encapsulating the content of doClean up to the point where
$errorSchema is thrown:
public function getClean($values, &$errorSchema)
{
// cleaning process
}
protected function doClean($values)
{
$errorSchema = null;
$clean = $this->tryClean($values, $errorSchema);
if (count($errorSchema))
{
throw $errorSchema;
}
return $clean;
}
Would this be worth submitting a patch for?
Thanks,
Ilia Jerebtsov
--
You received this message because you are subscribed to the Google Groups
"symfony developers" 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-devs?hl=en.