1Template::Plugin::CGI(3U)ser Contributed Perl DocumentatiToenmplate::Plugin::CGI(3)
2
3
4
6 Template::Plugin::CGI - Interface to the CGI module
7
9 [% USE CGI %]
10 [% CGI.param('parameter') %]
11
12 [% USE things = CGI %]
13 [% things.param('name') %]
14
15 # see CGI docs for other methods provided by the CGI object
16
18 This is a very simple Template Toolkit Plugin interface to the "CGI"
19 module. A "CGI" object will be instantiated via the following
20 directive:
21
22 [% USE CGI %]
23
24 "CGI" methods may then be called as follows:
25
26 [% CGI.header %]
27 [% CGI.param('parameter') %]
28
29 An alias can be used to provide an alternate name by which the object
30 should be identified.
31
32 [% USE mycgi = CGI %]
33 [% mycgi.start_form %]
34 [% mycgi.popup_menu({ Name => 'Color'
35 Values => [ 'Green' 'Black' 'Brown' ] }) %]
36
37 Parenthesised parameters to the "USE" directive will be passed to the
38 plugin constructor:
39
40 [% USE cgiprm = CGI('uid=abw&name=Andy+Wardley') %]
41 [% cgiprm.param('uid') %]
42
44 In addition to all the methods supported by the "CGI" module, this
45 plugin defines the following.
46
47 params()
48 This method returns a reference to a hash of all the "CGI" parameters.
49 Any parameters that have multiple values will be returned as lists.
50
51 [% USE CGI('user=abw&item=foo&item=bar') %]
52 [% CGI.params.user %] # abw
53 [% CGI.params.item.join(', ') %] # foo, bar
54
56 Andy Wardley <abw@wardley.org> <http://wardley.org/>
57
59 Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
60
61 This module is free software; you can redistribute it and/or modify it
62 under the same terms as Perl itself.
63
65 Template::Plugin, CGI
66
67
68
69perl v5.34.0 2021-07-23 Template::Plugin::CGI(3)