CGI::T...:Input(3pm)

πŸ“¦
version 1.111 Β· 2 versions
  • 1.111 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.111 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, welcome to CGI::Test::Form::Widget::Input (3pm) β€” the abstract representation of an input field πŸ’… she's a Perl module, she's iconic, she's the blueprint, not the actual thing. Periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

# Inherits from CGI::Test::Form::Widget

that's it. that's the whole vibe. she's a child class and she knows it πŸ’–


🌸 DESCRIPTION 🌸

so this class is the abstract representation of a text input field, which like β€” bestie β€” covers a LOT of ground. we're talking:

  • a text field
  • a password field
  • a file upload field
  • a text area

basically every place a user can type their little heart out πŸŽ€

and because typing is literally the main character of this whole situation, there's a whole squad of routines to simulate user input in those fields. you can prepend(), append(), replace(), clear(), or even run whatever text is already sitting there through a filter(). it's giving full editorial control over the text ✨


πŸ‘‘ INTERFACE πŸ‘‘

the interface is the same as the one described in CGI::Test::Form::Widget, with the following additions:


πŸ’œ Attribute Setting πŸ’œ

there are a number of convenience routines that are wrappers on set_value() β€” think of them as the cute lil shortcuts so you don't have to do the whole thing yourself 🫢

  • append string β€” Appends the string text to the existing text.
  • clear β€” Clears existing text.
  • filter filter_routine β€” Runs existing text through the given filter_routine. The $_ variable is set to the whole text value, and is made available to the filter. Hence you may write:
$input->filter(sub { s/this/that/g });

to replace all instances of this by that within the input text. ngl that one's kinda chef's kiss πŸ‘©β€πŸ³πŸ’‹

  • prepend string β€” Prepends the string text to the existing text.
  • replace string β€” Replaces the existing text with string.

🧚 Widget Classification Predicates 🧚

there are additional predicates to distinguish between the various input fields β€” like a vibe check but for widget types 😌

  • is_area β€” Returns true for a text area.
  • is_field β€” Returns true for a pure text field.
  • is_file β€” Returns true for a file upload field (text field with browser support for file selection).
  • is_password β€” Returns true for a password field (text field with input masked by GUI).

🌈 AUTHORS 🌈

giving credit where credit is due, no cap:

  • The original author is Raphael Manfredi.
  • Steven Hilton was long time maintainer of this module.
  • Current maintainer is Alexander Tokarev <tokarev@cpan.org>.

⭐ SEE ALSO ⭐

go read these next, bestie, they're the whole friend group πŸ’–


okay that's the whole page, mwah πŸ’‹ this lil gem shipped with perl v5.34.0 back on 2022-06-10, and honestly? she still slays. periodt. πŸŽ€βœ¨πŸ¦‹