1HTML::FormFu::ConstrainUts:e:rCaClolnbtarcikb(u3t)ed PerHlTMDLo:c:uFmoernmtFaut:i:oCnonstraint::Callback(3)
2
3
4
6 HTML::FormFu::Constraint::Callback - Code Callback Constraint
7
9 version 2.07
10
12 $field->constraint({
13 type => 'Callback',
14 callback => \&foo,
15 });
16
17 ---
18 elements:
19 - type: Text
20 name: foo
21 constraints:
22 - type: Callback
23 callback: "main::my_constraint"
24
25 sub foo {
26 my ( $value, $params ) = @_;
27
28 # return true or false
29 }
30
32 The first argument passed to the callback is the submitted value for
33 the associated field. The second argument passed to the callback is a
34 hashref of name/value pairs for all input fields.
35
36 This constraint doesn't honour the not() value.
37
39 callback
40 Arguments: \&code-reference
41
42 Arguments: "subroutine-name"
43
45 Is a sub-class of, and inherits methods from HTML::FormFu::Constraint
46
47 HTML::FormFu
48
50 Carl Franks "cfranks@cpan.org"
51
53 This library is free software, you can redistribute it and/or modify it
54 under the same terms as Perl itself.
55
57 Carl Franks <cpan@fireartist.com>
58
60 This software is copyright (c) 2018 by Carl Franks.
61
62 This is free software; you can redistribute it and/or modify it under
63 the same terms as the Perl 5 programming language system itself.
64
65
66
67perl v5.36.0 2023-01-H2T0ML::FormFu::Constraint::Callback(3)