logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Validation::Class::Directive::DependsOn - DependsOn Directive for Validation Class Field Definitions

Author

       Al Newkirk <anewkirk@ana.io>

Description

       Validation::Class::Directive::DependsOn is a core validation class field directive that validates the
       existence of dependent parameters.

       •       alternative argument: an-array-of-parameter-names

               This directive can be passed a single value or an array of values:

                   fields => {
                       password2_confirmation => {
                           depends_on => ['password', 'password2']
                       }
                   }

Name

       Validation::Class::Directive::DependsOn - DependsOn Directive for Validation Class Field Definitions

Synopsis

           use Validation::Class::Simple;

           my $rules = Validation::Class::Simple->new(
               fields => {
                   password_confirmation  => {
                       depends_on => 'password'
                   }
               }
           );

           # set parameters to be validated
           $rules->params->add($parameters);

           # validate
           unless ($rules->validate) {
               # handle the failures
           }

Version

       version 7.900059

See Also