~ubuntu-branches/ubuntu/quantal/libtemplate-perl/quantal

« back to all changes in this revision

Viewing changes to html/old/modules/Template/Plugin/CGI.html

  • Committer: Package Import Robot
  • Author(s): Benjamin Mako Hill
  • Date: 2012-04-08 19:06:29 UTC
  • mfrom: (0.7.1) (0.5.2) (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120408190629-wbcbs2ea39mex6lt
Tags: 2.24-1
* New upstream release (Closes: #664561)
* Bump Standards-Version to 3.9.3
* Changed to the short description to mention the term "Template
  Toolkit". (LP: #688836)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
 
4
<html>
 
5
  <head>
 
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">
 
12
    <!--[if IE 6]>
 
13
    <link rel="stylesheet" type="text/css" href="../../../css/ie6.css" />
 
14
    <![endif]-->
 
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">
 
19
  </head>
 
20
  <body id="body"> 
 
21
    <div id="layout">
 
22
        <div id="header">
 
23
          <a href="../../../index.html" id="logo" alt="" title="Click for the Home Page"><span class="alt">TT2 Home Page</span></a>
 
24
          <ul id="trail">
 
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>
 
29
          </ul>
 
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>
 
33
            </a>
 
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>
 
36
            </a>
 
37
          
 
38
          <div class="pager">
 
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>
 
42
          </div>
 
43
          </div>
 
44
          <h1 class="headline">Template::Plugin::CGI</h1>
 
45
          <h2 class="subhead">Interface to the CGI module</h1>
 
46
        
 
47
        </div>
 
48
        <div id="page">
 
49
          <div id="sidebar">
 
50
            <a href="../../../index.html" id="logo"></a>
 
51
            <div id="menu">
 
52
              <ul class="menu">
 
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>
 
101
              </ul>
 
102
              <div class="foot"></div>
 
103
            </div>
 
104
          </div>
 
105
          <div id="content">
 
106
          <div class="section">
 
107
            <div class="head">
 
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>
 
110
            </div>
 
111
            <div class="body">
 
112
              <ul class="toc">
 
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>
 
120
              
 
121
              </ul>
 
122
            </div>
 
123
          </div>
 
124
          
 
125
                <div class="pod">
 
126
            <div class="section">
 
127
              <div class="head">
 
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>
 
130
              </div>
 
131
              <div class="body">
 
132
                <pre>[% USE CGI %]
 
133
[% CGI.param('parameter') %]
 
134
 
 
135
[% USE things = CGI %]
 
136
[% things.param('name') %]
 
137
 
 
138
# see CGI docs for other methods provided by the CGI object</pre>
 
139
              </div>
 
140
            </div>
 
141
            <div class="section">
 
142
              <div class="head">
 
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>
 
145
              </div>
 
146
              <div class="body">
 
147
                <p>
 
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:
 
151
                    </p>
 
152
                    <pre>[% USE CGI %]</pre>
 
153
                    <p>
 
154
                      <code>CGI</code> methods may then be called as follows:
 
155
                    </p>
 
156
                    <pre>[% CGI.header %]
 
157
[% CGI.param('parameter') %]</pre>
 
158
                    <p>
 
159
                      An alias can be used to provide an alternate name by which the object
 
160
                      should be identified.
 
161
                    </p>
 
162
                    <pre>[% USE mycgi = CGI %]
 
163
[% mycgi.start_form %]
 
164
[% mycgi.popup_menu({ Name   =&gt; 'Color'
 
165
                      Values =&gt; [ 'Green' 'Black' 'Brown' ] }) %]</pre>
 
166
                    <p>
 
167
                      Parenthesised parameters to the <code>USE</code> directive will be passed
 
168
                      to the plugin constructor:
 
169
                    </p>
 
170
                    <pre>[% USE cgiprm = CGI('uid=abw&amp;name=Andy+Wardley') %]
 
171
[% cgiprm.param('uid') %]</pre>
 
172
              </div>
 
173
            </div>
 
174
            <div class="section">
 
175
              <div class="head">
 
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>
 
178
              </div>
 
179
              <div class="body">
 
180
                <p>
 
181
                      In addition to all the methods supported by the <code>CGI</code> module,
 
182
                      this plugin defines the following.
 
183
                    </p>
 
184
                    <div class="subsection">
 
185
                  <div class="head">
 
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>
 
188
                  </div>
 
189
                  <div class="body">
 
190
                    <p>
 
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
 
193
                          lists.
 
194
                        </p>
 
195
                        <pre>[% USE CGI('user=abw&amp;item=foo&amp;item=bar') %]
 
196
[% CGI.params.user %]            # abw
 
197
[% CGI.params.item.join(', ') %] # foo, bar</pre>
 
198
                  </div>
 
199
                </div>
 
200
              </div>
 
201
            </div>
 
202
            <div class="section">
 
203
              <div class="head">
 
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>
 
206
              </div>
 
207
              <div class="body">
 
208
                <p>
 
209
                      Andy Wardley &lt;abw@wardley.org&gt; <a
 
210
                      href="http://wardley.org/">http://wardley.org/</a>
 
211
                    </p>
 
212
              </div>
 
213
            </div>
 
214
            <div class="section">
 
215
              <div class="head">
 
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>
 
218
              </div>
 
219
              <div class="body">
 
220
                <p>
 
221
                      Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
 
222
                    </p>
 
223
                    <p>
 
224
                      This module is free software; you can redistribute it and/or modify it
 
225
                      under the same terms as Perl itself.
 
226
                    </p>
 
227
              </div>
 
228
            </div>
 
229
            <div class="section">
 
230
              <div class="head">
 
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>
 
233
              </div>
 
234
              <div class="body">
 
235
                <p>
 
236
                      <a href="../../../modules/Template/Plugin.html">Template::Plugin</a>, <a
 
237
                      href="http://search.cpan.org/search?query=CGI&mode=all">CGI</a>
 
238
                    </p>
 
239
              </div>
 
240
            </div>
 
241
            
 
242
            </div></div>
 
243
          <br class="clear" />
 
244
          <div class="pageinfo">
 
245
            /modules/Template/Plugin/CGI.html last modified 10:54:57 31-May-2007
 
246
          </div>
 
247
        </div>
 
248
        
 
249
        <div id="footer">
 
250
          <a href="http://opensource.org/" class="osi"></a>
 
251
          <div class="controls">
 
252
          <div class="pager">
 
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>
 
256
          </div>
 
257
          </div>
 
258
          <div class="copyright">
 
259
            Copyright &copy; 1996-2007 <a href="http://wardley.org/">Andy Wardley</a>.  All Rights Reserved.
 
260
          </div>
 
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>.
 
265
          </div>
 
266
        </div>
 
267
        <div id="palette">
 
268
          <ul>
 
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>
 
274
          </ul>
 
275
        </div>
 
276
    </div>  </body>
 
277
</html>