1Validation::Class::DireUcsteirveC:o:nDterpiebnudtseVOdanl(Pi3ed)raltiDoonc:u:mCelnatsast:i:oDnirective::DependsOn(3)
2
3
4
6 Validation::Class::Directive::DependsOn - DependsOn Directive for
7 Validation Class Field Definitions
8
10 version 7.900059
11
13 use Validation::Class::Simple;
14
15 my $rules = Validation::Class::Simple->new(
16 fields => {
17 password_confirmation => {
18 depends_on => 'password'
19 }
20 }
21 );
22
23 # set parameters to be validated
24 $rules->params->add($parameters);
25
26 # validate
27 unless ($rules->validate) {
28 # handle the failures
29 }
30
32 Validation::Class::Directive::DependsOn is a core validation class
33 field directive that validates the existence of dependent parameters.
34
35 • alternative argument: an-array-of-parameter-names
36
37 This directive can be passed a single value or an array of
38 values:
39
40 fields => {
41 password2_confirmation => {
42 depends_on => ['password', 'password2']
43 }
44 }
45
47 Al Newkirk <anewkirk@ana.io>
48
50 This software is copyright (c) 2011 by Al Newkirk.
51
52 This is free software; you can redistribute it and/or modify it under
53 the same terms as the Perl 5 programming language system itself.
54
55
56
57perl v5.36.0 202V3a-l0i4d-a0t3ion::Class::Directive::DependsOn(3)