Valida...pendsOn(3pm)
π NAME π
Validation::Class::Directive::DependsOn β bestie, it's the DependsOn directive for Validation Class Field Definitions. That's the whole vibe. It's the little field-level rule that goes "hey, this thing can't show up alone, it needs its friends here first." π
You'll see it filed under the manual page name Valida...pendsOn(3pm) (yes the name is squished, that's just how the page is titled, don't @ me).
β¨ VERSION β¨
version 7.900059
That's the one, that's the version, no cap. π
π¦ SYNOPSIS π¦
okay so here's how you actually use it:
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
}
see how password_confirmation is like "I'm not validating unless password is here too"? that's the entire plot. it's giving codependent in the healthiest way possible π«Ά
πΈ DESCRIPTION πΈ
Validation::Class::Directive::DependsOn is a core validation class field directive, and what it does is validate the existence of dependent parameters. literally its whole job. it checks that the parameters it's depending on are actually there. that's it, that's the directive, and it ate. π₯
- 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']
}
}
so one dependency? cute. a whole list of dependencies? also completely valid, you just hand it an array. main character energy either way β¨
π AUTHOR π
Al Newkirk <anewkirk@ana.io>
the icon who wrote it. respect. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
bestie that means it's free software, go forth and remix, just keep the same terms as Perl 5 itself. periodt. π
and that's a wrap! this page came from the User Contributed Perl Documentation, it's perl v5.36.0, dated 2023-06-11, and it was serving Valida...pendsOn(3pm) the entire time. ily, go validate something responsibly ππ¦β
π¦ where this page comes from
- debian trixie: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms