HTML::...Sprintf(3pm)

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

πŸ’– HTML::FormFu::Filter::CompoundSprintf β€” CompoundSprintf filter πŸ’–

okay bestie, this is the manual page for HTML::FormFu::Filter::CompoundSprintf, coming at you from the User Contributed Perl Documentation (that's the 3pm situation, iykyk). Let's get into it ✨

🌸 VERSION 🌸

version 2.07 β€” she's serving, she's stable, she's on the current release πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

---
element:
  - type: Multi
    name: date

    elements:
      - name: day
      - name: month
      - name: year

    filter:
      - type: CompoundSprintf
        sprintf: '%02d-%02d-%04d'

and then, like, to actually get the compound-value back out:

# get the compound-value

my $date = $form->param_value('date');

no cap, that's the whole vibe 🫢


πŸŽ€ DESCRIPTION πŸŽ€

So this filter is for when you're rolling with a HTML::FormFu::Element::Multi group of fields β€” you know, the squad of inputs that all belong to one little crew 🌈

What it does is: it takes a sprintf pattern and uses it to join up the input from several fields into one single value. Multiple boxes in, one cute little string out. iconic behavior honestly πŸ’–


πŸ‘‘ METHODS πŸ‘‘

✨ sprintf ✨

Arguments: $string

This is the sprintf pattern that joins the individually submitted parts together. And ngl, the pattern gets passed straight to the perl-core sprintf function β€” no middleman, no edits, just straight through πŸ”₯

✨ field_order ✨

Inherited, bestie. For the details you gotta see "field_order" in HTML::FormFu::Filter::_Compound.

Here's what it looks like in the wild:

---
element:
  - type: Multi
    name: date

    elements:
      - name: month
      - name: day
      - name year

    filter:
      - type: CompoundSprintf
        field_order:
          - day
          - month
          - year

(yes, - name year is written exactly like that up there, we do not touch the source material πŸ™ˆ)


πŸ’œ 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>

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 a wrap, gorgeous ✨ this page came to you on perl v5.28.1, dated 2019-01-12, and it's the HTML::...Sprintf(3pm) page β€” slay, go build your compound fields, mwah πŸ’‹

πŸ“¦ where this page comes from