.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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::FormBuilder::Template::CGI_SSI 3" .TH CGI::FormBuilder::Template::CGI_SSI 3 2024-09-01 "perl v5.40.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::FormBuilder::Template::CGI_SSI \- FormBuilder interface to CGI::SSI .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 7 \& my $form = CGI::FormBuilder\->new( \& fields => \e@fields, \& template => { \& type => \*(AqCGI_SSI\*(Aq, \& file => "template.html", \& }, \& ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This engine adapts \fBFormBuilder\fR to use \f(CW\*(C`CGI::SSI\*(C'\fR. .PP You can specify any options which \f(CW\*(C`CGI::SSI\->new\*(C'\fR accepts by using a hashref: .PP .Vb 8 \& my $form = CGI::FormBuilder\->new( \& fields => \e@fields, \& template => { \& type => \*(AqCGI::SSI\*(Aq, \& file => \*(Aqform.shtml\*(Aq, \& sizefmt => \*(Aqabbrev\*(Aq \& } \& ); .Ve .PP In addition to CGI::SSI \fBnew\fR arguments, you can also specify \f(CW\*(C`file\*(C'\fR, \f(CW\*(C`virtual\*(C'\fR, or \f(CW\*(C`string\*(C'\fR argument. .PP The following methods are provided (usually only used internally): .SS engine .IX Subsection "engine" Returns a reference to the \f(CW\*(C`CGI::SSI\*(C'\fR object .SS prepare .IX Subsection "prepare" Returns a hash of all the fields ready to be rendered. .SS render .IX Subsection "render" Uses the prepared hash and expands the template, returning a string of HTML. .SH TEMPLATES .IX Header "TEMPLATES" In your template, each of the form fields will correspond directly to a \f(CW\*(C`\*(C'\fR of the same name prefixed with "field\-" in the template. So, if you defined a field called "email", then you would setup a variable called \f(CW\*(C`\*(C'\fR in your template. .PP In addition, there are a couple special fields: .PP .Vb 6 \& \- JavaScript to stick in
\& \- TheYour full name: \&
Your email address: \&
Choose a password: \&
Please confirm it: \&
Your home zipcode: \&
\&
\&
.Ve
.PP
As you see, you get a \f(CW\*(C`\*(C'\fR for each for field you define.
.PP
However, you may want even more control. That is, maybe you want
to specify every nitty-gritty detail of your input fields, and
just want this module to take care of the statefulness of the
values. This is no problem, since this module also provides
several other \f(CW\*(C`