.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Application::Plugin::SuperForm 3" .TH CGI::Application::Plugin::SuperForm 3 "2020-07-28" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Application::Plugin::SuperForm \- Create sticky HTML forms in CGI::Application run modes using HTML::SuperForm .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use CGI::Application::Plugin::SuperForm; \& \& sub form_runmode { \& my $c = shift; \& \& my $form_start = $c\->superform\->start_form( \& { \& method => "POST", \& action => $c\->query()\->url() . "/myapp/form_process", \& } \& ); \& \& my $text = $c\->superform\->text( name => \*(Aqtext\*(Aq, default => \*(AqDefault Text\*(Aq ); \& \& my $textarea = $c\->superform\->textarea( \& name => \*(Aqtextarea\*(Aq, \& default => \*(AqMore Default Text\*(Aq \& ); \& \& my $select = $c\->superform\->select( \& name => \*(Aqselect\*(Aq, \& default => 2, \& values => [ 0, 1, 2, 3 ], \& labels => { \& 0 => \*(AqZero\*(Aq, \& 1 => \*(AqOne\*(Aq, \& 2 => \*(AqTwo\*(Aq, \& 3 => \*(AqThree\*(Aq \& } \& ); \& \& my $output = <<"END_HTML"; \& \&
\& \& \& \& END_HTML \& return $output; \& \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Create sticky forms with \f(CW\*(C`HTML::SuperForm\*(C'\fR. .SH "METHODS" .IX Header "METHODS" .IP "sform" 4 .IX Item "sform" alias to superform .IP "superform" 4 .IX Item "superform" Returns a instance of \f(CW\*(C`HTML::SuperForm\*(C'\fR preconfigured with sticky and fallback options on. See HTML::SuperForm for more information and examples. .SH "EXAMPLE USING TT PLUGIN" .IX Header "EXAMPLE USING TT PLUGIN" A simplistic but working app SuperForm, \s-1TT\s0 and AutoRunmode plugins. \s-1TT\s0 brings in 'c' var to templates automatically, SuperForm brings in 'sform'. .PP .Vb 1 \& Files: \& \& ./lib/MyApp.pm \& .MyApp/form.tmpl \& ./server.pl \& \& lib/MyApp.pm \& \& package MyApp; \& use base \*(AqTitanium\*(Aq; \& \& use CGI::Application::Plugin::TT; \& use CGI::Application::Plugin::SuperForm; \& use CGI::Application::Plugin::AutoRunmode; \& \& sub form: Runmode{ \& my $c = shift; \& $c\->tt_process(); \& } \& \& \& sub process_form(): Runmode{ \& my $c = shift; \& # do something with user input. \& # redirect to success page, etc. \& return "You said: ". $c\->query()\->param(\*(Aqinput1\*(Aq); \& } \& \& \& \& 1; # End of MyApp \& \& MyApp/form.tmpl \& \& \& [% c.sform.start_form({method=>"POST"}) %]