.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 "Template::Plugin::CGI 3pm" .TH Template::Plugin::CGI 3pm 2024-03-07 "perl v5.38.2" "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 Template::Plugin::CGI \- Interface to the CGI module .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& [% USE CGI %] \& [% CGI.param(\*(Aqparameter\*(Aq) %] \& \& [% USE things = CGI %] \& [% things.param(\*(Aqname\*(Aq) %] \& \& # see CGI docs for other methods provided by the CGI object .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This is a very simple Template Toolkit Plugin interface to the \f(CW\*(C`CGI\*(C'\fR module. A \f(CW\*(C`CGI\*(C'\fR object will be instantiated via the following directive: .PP .Vb 1 \& [% USE CGI %] .Ve .PP \&\f(CW\*(C`CGI\*(C'\fR methods may then be called as follows: .PP .Vb 2 \& [% CGI.header %] \& [% CGI.param(\*(Aqparameter\*(Aq) %] .Ve .PP An alias can be used to provide an alternate name by which the object should be identified. .PP .Vb 4 \& [% USE mycgi = CGI %] \& [% mycgi.start_form %] \& [% mycgi.popup_menu({ Name => \*(AqColor\*(Aq \& Values => [ \*(AqGreen\*(Aq \*(AqBlack\*(Aq \*(AqBrown\*(Aq ] }) %] .Ve .PP Parenthesised parameters to the \f(CW\*(C`USE\*(C'\fR directive will be passed to the plugin constructor: .PP .Vb 2 \& [% USE cgiprm = CGI(\*(Aquid=abw&name=Andy+Wardley\*(Aq) %] \& [% cgiprm.param(\*(Aquid\*(Aq) %] .Ve .SH METHODS .IX Header "METHODS" In addition to all the methods supported by the \f(CW\*(C`CGI\*(C'\fR module, this plugin defines the following. .SS \fBparams()\fP .IX Subsection "params()" This method returns a reference to a hash of all the \f(CW\*(C`CGI\*(C'\fR parameters. Any parameters that have multiple values will be returned as lists. .PP .Vb 3 \& [% USE CGI(\*(Aquser=abw&item=foo&item=bar\*(Aq) %] \& [% CGI.params.user %] # abw \& [% CGI.params.item.join(\*(Aq, \*(Aq) %] # foo, bar .Ve .SH AUTHOR .IX Header "AUTHOR" Andy Wardley .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 1996\-2007 Andy Wardley. All Rights Reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Template::Plugin, CGI