Form::...:select(3pm)
π NAME π
Embperl::Form::Control::select β bestie, it's a select control living inside an Embperl Form π
β¨ SYNOPSIS β¨
okay so here's the whole vibe, copy-paste ready:
{
type => 'select',
text => 'blabla',
name => 'foo',
values => [1,2,3],
options => ['foo', 'bar', 'none'],
rows => 5
}
π¦ DESCRIPTION π¦
So basically this thing makes a select control inside an Embperl Form. That's it, that's the job π
If you wanna know how to actually pass in parameters, go read Embperl::Form β it's giving main character energy for all the param rules, and we're just living in its world.
πΈ PARAMETER πΈ
typeβ this one has to be'select'. No cap. It's the whole identity of the control, bestie.nameβ sets the name of the select control. That's the handle, the label the form world uses to find it π₯textβ this is what gets used as the label for the select control. Like the little caption on top. Iconic πvaluesβ hands over the values as an array ref for the select control. Yes, array ref, not a plain list, don't come for me.optionsβ gives you the options as an array ref β these are the things actually displayed to the user, the visible lil menu items β¨ And lowkey important: if you don't give any options at all, it just falls back to using the values fromvalues. Free real estate.rowsβ if you specify this, you get a select box displayed with that many lines. If you don't specify it, or it'sundef, you get a drop down list instead. So like,rows= big box energy, norows= tidy lil dropdown πaddtopβ an array ref holding items that get added at the top of the select box. Each item is itself an array ref with two entries: first one is the value, second one is the option displayed on the page. And if the second one is missing, the value (the first entry) is what gets displayed. Example:
addtop => [ [1 => 'first item'], [2 => 'second item']]
addbottomβ same deal but at the bottom of the select box: an array ref of items, each item an array ref with two entries, value first and displayed option second. If the second one's missing, the value (the first entry) is displayed. Example:
addbottom => [ [9999 => 'last item'], [9999 => 'very last item']]
filterβ if you give this, only the items whose value matches the regex you passed in"filter"get displayed. Filtered. Curated. Only the chosen ones make it to the page πmultipleβ set it to true and boom, multiple selections are allowed. Go wild, pick everything, it's your moment π«Ά
π Author π
G. Richter (richter at embperl dot org) β the actual legend behind this, we stan π
π See Also π
perl(1)EmbperlEmbperl::Form
and that's the whole page, bestie β brought to you by perl v5.34.0, dated 2022-02-06. slay, go build a form πβ¨π
π¦ where this page comes from
- ubuntu jammy: libembperl-perl 2.5.0-16build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms