HTML::...llback(3pm)
β¨ HTML::FormFu::Constraint::Callback β¨
okay bestie, so this is a page from the User Contributed Perl Documentation β and it's literally about HTML::FormFu::Constraint::Callback, aka the Code Callback Constraint π
version 2.07 btw. noted. π
π¦ SYNOPSIS π¦
here's the vibe, in Perl:
$field->constraint({
type => 'Callback',
callback => \&foo,
});
---
elements:
- type: Text
name: foo
constraints:
- type: Callback
callback: "main::my_constraint"
sub foo {
my ( $value, $params ) = @_;
# return true or false
}
like. you hand it a callback. the callback says yes or no. that's the whole gig. slay. π
πΈ DESCRIPTION πΈ
so here's what's actually happening under the hood, bestie, listen up:
- the first argument passed to the callback is the submitted value for the associated field β¨
- the second argument passed to the callback is a hashref of name/value pairs for all input fields π
ngl this constraint doesn't honour the not() value. like, it just doesn't. not me finding that out the hard way π
π METHODS π
π
callback
- Arguments:
\&code-referenceπ₯ - Arguments:
"subroutine-name"π₯
that's it. that's the method. give it a code ref or give it a subroutine name, both are valid, both are iconic. periodt. β¨
π§ SEE ALSO π§
- Is a sub-class of, and inherits methods from HTML::FormFu::Constraint π
- HTML::FormFu π
β AUTHOR β
Carl Franks cfranks@cpan.org π«Ά
π LICENSE π
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. π (yes, fr fr, go off.)
β AUTHOR β
Carl Franks <cpan@fireartist.com> π«
(yes there are two AUTHOR sections. the icon himself appears twice. we stan.)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2018 by Carl Franks.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πΈ
perl v5.28.1 Β· 2019-01-12 β and that's the whole page bestie, go build something cute with it π β¨π¦
π¦ where this page comes from
- debian bookworm: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formfu-perl 2.07000-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