logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

HTML::FormFu::Filter::Callback - filter with custom subroutine

Author

       Carl Franks <cpan@fireartist.com>

Description

       Filter using a user-provided subroutine.

License

       This library is free software, you can redistribute it and/or modify it under the same terms as Perl
       itself.

Methods

callback
       Arguments: \&code-reference

       Arguments: "subroutine-name"

Name

       HTML::FormFu::Filter::Callback - filter with custom subroutine

Synopsis

           $field->filter({
               type     => 'Callback',
               callback => \&my_filter,
           });

           ---
           elements:
             - type: Text
               name: foo
               filters:
                 - type: Callback
                   callback: "main::my_filter"

           sub my_filter {
               my ($value) = @_;

               # do something to $value

               return $value;
           }

Version

       version 2.07

See Also