Valida...::Mixin(3pm)

πŸ“¦
version 7.900059 Β· 7 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Valida...::Mixin(3pm) β€” the whole vibe πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's filed under Valida...::Mixin(3pm). Short one, but it's iconic β€” let's go 🫢


✨ NAME ✨

Validation::Class::Directive::Mixin β€” the Mixin Directive for Validation Class Field Definitions. that's literally it, that's the whole name, no notes πŸ’…


🌸 VERSION 🌸

version 7.900059 β€” yes, that's the actual number, no I will not be rounding it πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole thing in action, look at her:

use Validation::Class::Simple;

my $rules = Validation::Class::Simple->new(
    mixins => {
        basic => {
            required => 1,
            filters  => ['trim', 'strip']
        }
    }
    fields => {
        full_name => {
            mixin => 'basic'
        }
    }
);

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

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

see how we made a lil basic mixin with required => 1 and filters => ['trim', 'strip'], then just dropped mixin => 'basic' onto the full_name field? that's the whole move, so clean, so effortless, main character energy fr fr ✨


πŸ’œ DESCRIPTION πŸ’œ

so Validation::Class::Directive::Mixin is a core validation class field directive, and what it does β€” the entire job, no cap β€” is it determines what directive templates will be merged with the associated field. that's it. it's the little connector, the group-chat admin of directives, pulling a template in and merging it right onto your field. lowkey obsessed with how simple that is 🌸


πŸ‘‘ AUTHOR πŸ‘‘

Al Newkirk <anewkirk@ana.io> β€” the author, the moment, the legend 🫢


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. periodt. πŸ’–


and that's the page bestie!! short, sweet, slayed πŸ’…

made with love for perl v5.36.0, dated 2023-06-11, filed under Valida...::Mixin(3pm) 🌈⭐

πŸ“¦ where this page comes from