HTML::...Filter(3pm)

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

πŸ’– NAME πŸ’–

okay bestie, welcome to HTML::FormFu::Filter β€” the Filter Base Class ✨ it's literally the blueprint that every single filter in the FormFu universe is built on. she's the momager of filters. the blueprint. the blueprint-est. πŸŽ€

🌸 VERSION 🌸

version 2.07 β€” yes queen, she's on 2.07, we love a version number that ate πŸ’…

✨ SYNOPSIS ✨

here's the vibe, in YAML, no cap:

---
elements:
  - type: Text
    name: foo
    filters:
      - type: Encode
        candidates:
          - utf8
          - Hebrew
  - type: Text
    name: bar
    filters:
      - LowerCase
      - Encode
filters:
  - TrimEdges

look at her. nested filters inside elements, top-level filters chillin' at the bottom, TrimEdges just doing her thing for everybody. iconic behavior honestly πŸ¦‹


🫢 DESCRIPTION 🫢

so "filters()" and "filter" can be called on any form, block element (and yes that includes fieldsets, bestie, we see you) or field element. equal opportunity filtering. πŸ’–

if you call it on a field element? then no "name" argument should be passed. like, she already knows which field she is, don't make it weird.

if you call it on a form or block element and you don't pass a "name" argument, then a brand new filter gets created for β€” and added to β€” every single field on that form or block. not one field. not a few fields. every field. she's thorough like that πŸ’…βœ¨

want the deep lore? go read "FORM LOGIC AND VALIDATION" in HTML::FormFu. it's giving required reading πŸ“š

πŸŽ€ METHODS πŸŽ€

πŸ¦‹ type

returns the "type" argument that was originally used to create the filter. like, the receipts of how she was born. πŸ’œ

🌸 localise_args

gives you a way to provide arguments that should be passed to localize so you can swap out "[_1]", "[_2]", etc. in the localized string. placeholders? replaced. slay. ✨

πŸ’œ parent

returns the HTML::FormFu::Role::Element::Field object that the filter is associated with. that's her field. her person. her ride or die. 🫢

⭐ get_parent

Arguments: \%options

traverses the parent hierarchy and returns the first parent that matches the supplied options. she climbs the family tree until she finds the one. main character energy, honestly πŸ‘‘

🧚 form

returns the HTML::FormFu object that the filter's field is attached to. the whole form. the whole squad. 🌈

πŸ’– name

shorthand for $filter->parent->name β€” that's it, that's the whole method. short. sweet. efficient. periodt. πŸ’…


πŸ”₯ CORE FILTERS πŸ”₯

the whole friend group, right here, no gatekeeping:

  • HTML::FormFu::Filter::Callback
  • HTML::FormFu::Filter::CompoundJoin
  • HTML::FormFu::Filter::CompoundSprintf
  • HTML::FormFu::Filter::CopyValue
  • HTML::FormFu::Filter::Default
  • HTML::FormFu::Filter::Encode
  • HTML::FormFu::Filter::ForceListValue
  • HTML::FormFu::Filter::FormatNumber
  • HTML::FormFu::Filter::HTMLEscape
  • HTML::FormFu::Filter::HTMLScrubber
  • HTML::FormFu::Filter::LowerCase
  • HTML::FormFu::Filter::NonNumeric
  • HTML::FormFu::Filter::Regex
  • HTML::FormFu::Filter::Split
  • HTML::FormFu::Filter::TrimEdges
  • HTML::FormFu::Filter::UpperCase
  • HTML::FormFu::Filter::Whitespace

πŸ’… FILTER BASE CLASSES πŸ’…

these ones are the base classes for other filters, so bestie, you generally needn't use them directly. they're the backstage crew, not the performers. 🎭

  • HTML::FormFu::Filter::_Compound

πŸ‘‘ AUTHOR πŸ‘‘

Carl Franks, "cfranks@cpan.org" β€” king behavior, we stan 🫢

based on the original source code of HTML::Widget::Filter, by Sebastian Riedel. shoutout to the OGs, fr fr ✨


πŸ“œ LICENSE πŸ“œ

this library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. so like, go off, but respectfully πŸ’–


🌟 AUTHOR 🌟

Carl Franks <cpan@fireartist.com>


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.


and that's the whole page bestie!! πŸ¦‹ this one's from perl v5.28.1, dated 2019-01-12 β€” she's a vintage icon and she still serves πŸ’…βœ¨ go forth and filter, you absolute legend πŸŒˆπŸ’–
πŸ“¦ where this page comes from