Re: [dfv] Altering data in D::FV::Results
Status: Inactive
Brought to you by:
markjugg
|
From: Mark S. <ma...@su...> - 2008-08-06 20:55:31
|
On Wed, 06 Aug 2008 16:46:42 -0400
Michael Peters <mp...@pl...> wrote:
> Amelia Ireland wrote:
>
> > I want the validator to automatically ignore invalid and missing
> > fields for some query parameters and use the default instead. I've
> > created a subclass with this functionality, but I don't know whether
> > this is something that would be generally useful or not.
>
> Is it possible that you can do these things either before processing the
> data and/or in your validator methods?
>
> # before validation
> $query->param('can_be_missing' => $default)
> unless defined $query->param('can_be_missing');
>
> # in your validate method
> my $dfv = shift;
> my $val = $dfv->get_current_constraint_value();
> return $default if !defined $val;
> # do my real validation
Or along the same lines, the profile could be modified or replaced in a given
case, so that the missing/invalid came out as expected.
Mark
|