HTML::...allback(3pm)

πŸ“¦
version 2.07000 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

HTML::FormFu::Transformer::Callback β€” a Callback transformer, bestie. That's the whole vibe. πŸŽ€

Oh and btw, the manual page itself shows up as HTML::...allback(3pm) in the header and footer, that's just how it's filed, don't stress. πŸ¦‹

✨ VERSION ✨

version 2.07 β€” iconic, current, no notes. πŸ‘‘

🌸 SYNOPSIS 🌸

okay so here's how you actually use it, look:

    $field->transformer('Callback')->callback( \&my_transformer );

    ---
    elements:
      - type: Text
        name: foo
        transformers:
          - type: Callback
            callback: "main::my_transformer"

two ways to serve the same lewk: hand it a code ref in Perl, or name the sub in your config. slay. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so when your callback gets called, it gets two things handed to it, and you need to know what they are, fr fr:

  • first argument = the submitted value for the associated field. like, the actual thing the user typed in. πŸ“
  • second argument = a hashref of name/value pairs for all the input fields. yes, all of them, the whole roster. 🌈

that's it, that's the tea. 🫢

🧚 METHODS 🧚

callback

Arguments: \&code-reference

Arguments: "subroutine-name"

so you can pass it either a straight-up code reference (\&code-reference) or just the name of the subroutine as a string ("subroutine-name"). both valid, both cute, pick your fighter. 😭✨

πŸ’€ SEE ALSO πŸ’€

  • Is a sub-class of, and inherits methods from HTML::FormFu::Transformer β€” so all the inherited goodness comes along for free, periodt.
  • HTML::FormFu β€” the main character, obviously. πŸ‘‘

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

πŸ’… AUTHOR πŸ’…

Carl Franks <cpan@fireartist.com>

(yes bestie, he's listed twice, that's literally what the page says, I don't make the rules πŸ™ˆ)

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. 🌸


okay that's the whole page!! this one's running on perl v5.28.1, dated 2019-01-12, and it's filed under HTML::...allback(3pm) in the User Contributed Perl Documentation. go forth and transform, bestie πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from