3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
6
<title>Template::Plugin::CGI</title>
7
<link rel="stylesheet" type="text/css" href="../../../css/blue.css" title="Clear Blue">
8
<link rel="alternate stylesheet" type="text/css" href="../../../css/orange.css" title="Clear Orange">
9
<link rel="alternate stylesheet" type="text/css" href="../../../css/green.css" title="Clear Green">
10
<link rel="alternate stylesheet" type="text/css" href="../../../css/purple.css" title="Clear Purple">
11
<link rel="alternate stylesheet" type="text/css" href="../../../css/grey.css" title="Clear Grey">
13
<link rel="stylesheet" type="text/css" href="../../../css/ie6.css" />
15
<link rel="stylesheet" type="text/css" href="/css/print.css" media="print">
16
<script type="text/javascript" src="../../../js/tt2.js"></script>
17
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
18
<meta name="author" content="Andy Wardley">
23
<a href="../../../index.html" id="logo" alt="" title="Click for the Home Page"><span class="alt">TT2 Home Page</span></a>
25
<li><a href="../../../modules/index.html">Modules</a></li>
26
<li><a href="../../../modules/Template/index.html">Template::*</a></li>
27
<li><a href="../../../modules/Template/Plugin/index.html">Plugin::*</a></li>
28
<li class="last"><a href="../../../modules/Template/Plugin/CGI.html">CGI.pm</a></li>
30
<div class="controls">
31
<a href="#" class="menu show" onclick="widescreen_off(); return false" title="Show Menu">
32
<span class="about">Click to view the menu. It's very nice.</span>
34
<a href="#" class="menu hide" onclick="widescreen_on(); return false" title="Hide Menu">
35
<span class="about">Click to hide the menu and go all widescreen!</span>
39
<a href="../../../modules/Template/Plugin/Autoformat.html" title="Template::Plugin::Autoformat" class="go back">Back<span class="about"><h4>Template::Plugin::Autoformat</h4>Interface to Text::Autoformat module</span></a>
40
<a href="../../../modules/Template/Plugin/index.html" title="Template::Plugin::* Modules" class="go up">Up<span class="about"><h4>Template::Plugin::* Modules</h4></span></a>
41
<a href="../../../modules/Template/Plugin/Datafile.html" title="Template::Plugin::Datafile" class="go next">Next<span class="about"><h4>Template::Plugin::Datafile</h4>Plugin to construct records from a simple data file</span></a>
44
<h1 class="headline">Template::Plugin::CGI</h1>
45
<h2 class="subhead">Interface to the CGI module</h1>
50
<a href="../../../index.html" id="logo"></a>
53
<li class="l0 first"><a href="../../../manual/index.html">Manual</a></li>
54
<li class="l0"><a href="../../../modules/index.html" class="warm">Modules</a></li>
55
<li class="l1"><a href="../../../modules/Template.html">Template.pm</a></li>
56
<li class="l1"><a href="../../../modules/Template/index.html" class="warm">Template::*</a></li>
57
<li class="l2"><a href="../../../modules/Template/Base.html">Base.pm</a></li>
58
<li class="l2"><a href="../../../modules/Template/Config.html">Config.pm</a></li>
59
<li class="l2"><a href="../../../modules/Template/Constants.html">Constants.pm</a></li>
60
<li class="l2"><a href="../../../modules/Template/Context.html">Context.pm</a></li>
61
<li class="l2"><a href="../../../modules/Template/Directive.html">Directive.pm</a></li>
62
<li class="l2"><a href="../../../modules/Template/Document.html">Document.pm</a></li>
63
<li class="l2"><a href="../../../modules/Template/Exception.html">Exception.pm</a></li>
64
<li class="l2"><a href="../../../modules/Template/Filters.html">Filters.pm</a></li>
65
<li class="l2"><a href="../../../modules/Template/Grammar.html">Grammar.pm</a></li>
66
<li class="l2"><a href="../../../modules/Template/Iterator.html">Iterator.pm</a></li>
67
<li class="l2"><a href="../../../modules/Template/Namespace/index.html">Namespace::*</a></li>
68
<li class="l2"><a href="../../../modules/Template/Parser.html">Parser.pm</a></li>
69
<li class="l2"><a href="../../../modules/Template/Plugin.html">Plugin.pm</a></li>
70
<li class="l2"><a href="../../../modules/Template/Plugin/index.html" class="warm">Plugin::*</a></li>
71
<li class="l3"><a href="../../../modules/Template/Plugin/Autoformat.html">Autoformat.pm</a></li>
72
<li class="l3"><a href="../../../modules/Template/Plugin/CGI.html" class="warm">CGI.pm</a></li>
73
<li class="l3"><a href="../../../modules/Template/Plugin/Datafile.html">Datafile.pm</a></li>
74
<li class="l3"><a href="../../../modules/Template/Plugin/Date.html">Date.pm</a></li>
75
<li class="l3"><a href="../../../modules/Template/Plugin/Directory.html">Directory.pm</a></li>
76
<li class="l3"><a href="../../../modules/Template/Plugin/Dumper.html">Dumper.pm</a></li>
77
<li class="l3"><a href="../../../modules/Template/Plugin/File.html">File.pm</a></li>
78
<li class="l3"><a href="../../../modules/Template/Plugin/Filter.html">Filter.pm</a></li>
79
<li class="l3"><a href="../../../modules/Template/Plugin/Format.html">Format.pm</a></li>
80
<li class="l3"><a href="../../../modules/Template/Plugin/HTML.html">HTML.pm</a></li>
81
<li class="l3"><a href="../../../modules/Template/Plugin/Image.html">Image.pm</a></li>
82
<li class="l3"><a href="../../../modules/Template/Plugin/Iterator.html">Iterator.pm</a></li>
83
<li class="l3"><a href="../../../modules/Template/Plugin/Math.html">Math.pm</a></li>
84
<li class="l3"><a href="../../../modules/Template/Plugin/Pod.html">Pod.pm</a></li>
85
<li class="l3"><a href="../../../modules/Template/Plugin/Procedural.html">Procedural.pm</a></li>
86
<li class="l3"><a href="../../../modules/Template/Plugin/String.html">String.pm</a></li>
87
<li class="l3"><a href="../../../modules/Template/Plugin/Table.html">Table.pm</a></li>
88
<li class="l3"><a href="../../../modules/Template/Plugin/URL.html">URL.pm</a></li>
89
<li class="l3"><a href="../../../modules/Template/Plugin/View.html">View.pm</a></li>
90
<li class="l3"><a href="../../../modules/Template/Plugin/Wrap.html">Wrap.pm</a></li>
91
<li class="l2"><a href="../../../modules/Template/Plugins.html">Plugins.pm</a></li>
92
<li class="l2"><a href="../../../modules/Template/Provider.html">Provider.pm</a></li>
93
<li class="l2"><a href="../../../modules/Template/Service.html">Service.pm</a></li>
94
<li class="l2"><a href="../../../modules/Template/Stash.html">Stash.pm</a></li>
95
<li class="l2"><a href="../../../modules/Template/Stash/index.html">Stash::*</a></li>
96
<li class="l2"><a href="../../../modules/Template/Test.html">Test.pm</a></li>
97
<li class="l2"><a href="../../../modules/Template/VMethods.html">VMethods.pm</a></li>
98
<li class="l2"><a href="../../../modules/Template/View.html">View.pm</a></li>
99
<li class="l0"><a href="../../../tools/index.html">Tools</a></li>
100
<li class="l0 last"><a href="../../../tutorial/index.html">Tutorial</a></li>
102
<div class="foot"></div>
106
<div class="section">
108
<h1 id="contents" onclick="switch_section(this)" title="Click title to show/hide section content.">Contents</h1>
109
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
113
<li class=""><a href="#SYNOPSIS">SYNOPSIS</a></li>
114
<li class=""><a href="#DESCRIPTION">DESCRIPTION</a></li>
115
<li class=""><a href="#METHODS">METHODS</a></li>
116
<li class="sub"><a href="#method_params">params()</a></li>
117
<li class=""><a href="#AUTHOR">AUTHOR</a></li>
118
<li class=""><a href="#COPYRIGHT">COPYRIGHT</a></li>
119
<li class=""><a href="#SEE_ALSO">SEE ALSO</a></li>
126
<div class="section">
128
<h1 id="SYNOPSIS" onclick="switch_section(this)" title="Click title to show/hide section content.">SYNOPSIS</h1>
129
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
133
[% CGI.param('parameter') %]
135
[% USE things = CGI %]
136
[% things.param('name') %]
138
# see CGI docs for other methods provided by the CGI object</pre>
141
<div class="section">
143
<h1 id="DESCRIPTION" onclick="switch_section(this)" title="Click title to show/hide section content.">DESCRIPTION</h1>
144
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
148
This is a very simple Template Toolkit Plugin interface to the
149
<code>CGI</code> module. A <code>CGI</code> object will be instantiated
150
via the following directive:
152
<pre>[% USE CGI %]</pre>
154
<code>CGI</code> methods may then be called as follows:
156
<pre>[% CGI.header %]
157
[% CGI.param('parameter') %]</pre>
159
An alias can be used to provide an alternate name by which the object
160
should be identified.
162
<pre>[% USE mycgi = CGI %]
163
[% mycgi.start_form %]
164
[% mycgi.popup_menu({ Name => 'Color'
165
Values => [ 'Green' 'Black' 'Brown' ] }) %]</pre>
167
Parenthesised parameters to the <code>USE</code> directive will be passed
168
to the plugin constructor:
170
<pre>[% USE cgiprm = CGI('uid=abw&name=Andy+Wardley') %]
171
[% cgiprm.param('uid') %]</pre>
174
<div class="section">
176
<h1 id="METHODS" onclick="switch_section(this)" title="Click title to show/hide section content.">METHODS</h1>
177
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
181
In addition to all the methods supported by the <code>CGI</code> module,
182
this plugin defines the following.
184
<div class="subsection">
186
<h2 id="method_params" class="method" onclick="switch_subsection(this)" title="Click title to show/hide sub-section content.">params()</h2>
187
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
191
This method returns a reference to a hash of all the <code>CGI</code>
192
parameters. Any parameters that have multiple values will be returned as
195
<pre>[% USE CGI('user=abw&item=foo&item=bar') %]
196
[% CGI.params.user %] # abw
197
[% CGI.params.item.join(', ') %] # foo, bar</pre>
202
<div class="section">
204
<h1 id="AUTHOR" onclick="switch_section(this)" title="Click title to show/hide section content.">AUTHOR</h1>
205
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
209
Andy Wardley <abw@wardley.org> <a
210
href="http://wardley.org/">http://wardley.org/</a>
214
<div class="section">
216
<h1 id="COPYRIGHT" onclick="switch_section(this)" title="Click title to show/hide section content.">COPYRIGHT</h1>
217
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
221
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
224
This module is free software; you can redistribute it and/or modify it
225
under the same terms as Perl itself.
229
<div class="section">
231
<h1 id="SEE_ALSO" onclick="switch_section(this)" title="Click title to show/hide section content.">SEE ALSO</h1>
232
<a href="#body" class="top" title="Back up to the top of the page" >Top</a>
236
<a href="../../../modules/Template/Plugin.html">Template::Plugin</a>, <a
237
href="http://search.cpan.org/search?query=CGI&mode=all">CGI</a>
244
<div class="pageinfo">
245
/modules/Template/Plugin/CGI.html last modified 10:54:57 31-May-2007
250
<a href="http://opensource.org/" class="osi"></a>
251
<div class="controls">
253
<a href="../../../modules/Template/Plugin/Autoformat.html" title="Template::Plugin::Autoformat" class="go back">Back<span class="about"><h4>Template::Plugin::Autoformat</h4></span></a>
254
<a href="../../../modules/Template/Plugin/index.html" title="Template::Plugin::* Modules" class="go up">Up<span class="about"><h4>Template::Plugin::* Modules</h4></span></a>
255
<a href="../../../modules/Template/Plugin/Datafile.html" title="Template::Plugin::Datafile" class="go next">Next<span class="about"><h4>Template::Plugin::Datafile</h4></span></a>
258
<div class="copyright">
259
Copyright © 1996-2007 <a href="http://wardley.org/">Andy Wardley</a>. All Rights Reserved.
261
<div class="licence">
262
The <a href="http://template-toolkit.org/">Template Toolkit</a> is <a href="http://opensource.org/">Open Source</a> software.
263
You can redistribute and/or modify it under the terms of the <a href="http://www.opensource.org/licenses/gpl-license.php">GNU Public Licence</a>
264
or the <a href="http://www.opensource.org/licenses/artistic-license.php">Perl Artistic Licence</a>.
269
<li class="first"><a href="#" class="blue" onclick="set_style('Clear Blue')"></a></li>
270
<li><a href="#" class="orange" onclick="set_style('Clear Orange')"></a></li>
271
<li><a href="#" class="green" onclick="set_style('Clear Green')"></a></li>
272
<li><a href="#" class="purple" onclick="set_style('Clear Purple')"></a></li>
273
<li><a href="#" class="grey" onclick="set_style('Clear Grey')"></a></li>