Valida...Filters(3pm)
π Validation::Class::Directive::Filters β the whole vibe π
okay so bestie, gather round, because we're talking about Validation::Class::Directive::Filters, which is a directive from the Validation::Class family β it lives in the User Contributed Perl Documentation section of the manual pages (that's the 3pm part, iykyk). It's the one that tells your fields which filter should get run on them. Slay. β¨
πΈ NAME πΈ
Validation::Class::Directive::Filters β the Filters Directive for Validation Class Field Definitions. She's a directive, she filters fields, she's iconic, periodt. π
π VERSION π
version 7.900059 β yes, that's the actual number, no I will not round it, she earned every digit. π«Ά
β¨ SYNOPSIS β¨
here's the whole situation, exactly as it goes down:
use Validation::Class::Simple;
my $rules = Validation::Class::Simple->new(
fields => {
user_ident => {
filters => 'trim'
}
}
);
# set parameters to be validated
$rules->params->add($parameters);
# validate
unless ($rules->validate) {
# handle the failures
}
so you spin up your rules, you hand her a field with a filters entry, you add your params with $rules->params->add($parameters), and then you call $rules->validate. If it comes back false, that's your cue to handle the failures. no cap. π
π¦ DESCRIPTION π¦
Validation::Class::Directive::Filters is a core validation class field directive that specifies which filter should be executed on the associated field. That's the whole job. She's the glow-up department for your data. π
- alternative argument:
an-array-of-options - option:
trime.g. remove leading/trailing spaces - option:
stripe.g. replace multiple spaces with one space - option:
lowercasee.g. convert to lowercase - option:
uppercasee.g. convert to uppercase - option:
titlecasee.g. uppercase first letter of each word; all else lowercase - option:
autocasee.g. uppercase first letter of each word - option:
capitalizee.g. uppercase the first letter - option:
alphanumerice.g. remove non-any alphanumeric characters - option:
numerice.g. remove any non-numeric characters - option:
alphae.g. remove any non-alpha characters - option:
decimale.g. preserve only numeric, dot and comma characters
and the way that this directive can be passed a single value or an array of values?? obsessed. look:
fields => {
user_ident => {
filters => ['trim', 'strip']
}
}
stack 'em, bestie. she can take one or she can take a whole lil squad. π
π AUTHOR π
Al Newkirk <anewkirk@ana.io> β the legend herself, main character energy, we love to see it. π«Ά
π 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. go forth, remix, redistribute, be free. π
and that's a wrap, bestie β this lil page came to you from perl v5.36.0, dated 2023-06-11, straight out of the 3pm manual section. stay filtered, stay iconic. bye babes πβ¨ππ¦
π¦ 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