CGI::T...::Check(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

πŸ’– CGI::Test::Form::Widget::Box::Check β€” the checkbox page πŸ’–

okay so bestie, welcome to the glow-up era of CGI::T...::Check(3pm) β€” yes the title is literally abbreviated like that in the Perl docs, no I will not be fixing it, it's giving mysterious. this is a page from the User Contributed Perl Documentation and it's all about the checkbox widget. let's get into it πŸŽ€


✨ NAME ✨

CGI::Test::Form::Widget::Box::Check β€” a checkbox widget. that's it, that's the whole vibe. a little box. you click it. it's checked. iconic behavior honestly πŸ‘‘


✨ SYNOPSIS ✨

here's the whole thing, copied exactly, do not perceive me editing it:

# Inherits from CGI::Test::Form::Widget::Box
# $form is a CGI::Test::Form

my ($agree, $ads) = $form->checkbox_by_name(qw(i_agree ads));

die "expected a standalone checkbox" unless $agree->is_standalone;
$agree->check;
$ads->uncheck_tagged("spam OK");

so first line, we're inheriting from CGI::Test::Form::Widget::Box, which like, slay, family business πŸ’…. $form is a CGI::Test::Form in case you were wondering.

then we grab two checkboxes at once with $form->checkbox_by_name(qw(i_agree ads)) and they land in ($agree, $ads). two besties, one call, we love efficiency 🫢

then the die line: die "expected a standalone checkbox" unless $agree->is_standalone; β€” we are manifesting that $agree is a standalone checkbox and if it's not, we crash out. periodt.

then $agree->check; β€” check it, bestie βœ…

and $ads->uncheck_tagged("spam OK"); β€” untag that one, "spam OK" does NOT get to stay checked, not on our watch 😭


✨ DESCRIPTION ✨

so this class represents a checkbox widget. and the way that it works is β€” users can check it or uncheck it, at will, whenever they want, no cap. total freedom, total main character energy.

and here's the lowkey important bit: the interface is the same as the one described in CGI::Test::Form::Widget::Box. so if you already know Box, you already know this. if you don't... girl, go read Box. iykyk 🌸


✨ AUTHORS ✨

giving credit where credit is due, fr fr:

  • the original author is Raphael Manfredi.
  • Steven Hilton was long time maintainer of this module. (their words, not mine β€” "long time maintainer", respect the tenure πŸ‘‘)
  • current maintainer is Alexander Tokarev <tokarev@cpan.org>.

three icons, one module. the lineage is unmatched 🌈


✨ SEE ALSO ✨

go read these next, bestie, they're the whole friend group:

like. the Box and the Radio. the checkbox's siblings. family reunion πŸ’œ


ngl this page is short and sweet and i am obsessed with that for us. checkbox lore: acquired. no notes πŸ’–

sign-off time 🌸 β€” this page is from perl v5.34.0, dated 2022-06-10, and it's CGI::T...::Check(3pm) in the User Contributed Perl Documentation. mwah, go check some boxes bestie πŸŽ€βœ¨