CGI::T...:Group(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::Group β€” bestie edition πŸ’–

okay so this is the manual page for CGI::Test::Form::Group, part of the User Contributed Perl Documentation, and it's basically the little clique-keeper for box-type widgets. let's get into it ✨


🌸 NAME 🌸

CGI::Test::Form::Group β€” it records groups of box-type widgets, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

like, imagine you have a form and you wanna poke at the radio groups:

# $form is a CGI::Test::Form object

use CGI::Test;

my $rgroup = $form->radio_groups;
ok 1, defined $rgroup;

my @title = $rgroup->widgets_in("title");
my ($mister) = grep { $_->value eq "Mr" } @title;
ok 2, $mister->is_checked;

see how easy that is?? iconic behavior fr fr πŸ’…


✨ DESCRIPTION ✨

so this class is literally just a container for box-type widgets β€” that means radio buttons and checkboxes β€” and those widgets may be groupped by name. (yes, "groupped", that's the word the docs use, we respect it 🫢)

you can query it to grab widgets that belong to a group, or to get all the group names. super handy.

and plot twist: CGI::Test uses it internally too, to keep track of associated radio buttons, so that checking one of them automatically unchecks the others in the same group. the way that works is honestly so satisfying, main character energy πŸ”₯


πŸ‘‘ INTERFACE πŸ‘‘

here's everything that's available to you, bestie:

  • is_groupname name β€” checks whether name is the name of a group. yes/no, simple as that βœ…
  • names β€” returns a list of group names, in random order. like, don't @ me about the order, it's random, that's the vibe 🎲
  • widget_count groupname β€” returns the amount of widgets held in groupname, and 0 if there are none. not zero yet, just zero πŸ“
  • widgets_in groupname β€” returns a list of all the widgets in the given groupname. and heads up: if the name is not a valid group name, the list will be empty. no error, no drama, just an empty list πŸ™ˆ

πŸ’œ AUTHORS πŸ’œ

  • 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 🧚


and that's the whole page, bestie πŸ’… this was perl v5.34.0, dated 2022-06-10, served up from the User Contributed Perl Documentation section 3pm. mwah, go forth and group your widgets πŸŽ€βœ¨πŸ’–