1CGI::Application::PlugiUns:e:rFiClolnItnrFiobrumt(e3d)PCeGrIl::DAopcpulmiecnattaitoino:n:Plugin::FillInForm(3)
2
3
4
6 CGI::Application::Plugin::FillInForm - integrate with HTML::FillInForm
7
9 use CGI::Application::Plugin::FillInForm (qw/fill_form/);
10
11 my $t = $self->load_tmpl('farm.html');
12 $t->param( organic => 'less_pesticides' );
13
14 return $self->fill_form( \$t->output );
15
17 This plugin provides a mix-in method to make using HTML::FillInForm
18 more convenient.
19
20 fill_form()
21 # fill an HTML form with data in a hashref or from an object with with a param() method
22 my $filled_html = $self->fill_form($html, $data);
23
24 # ...or fill from a list of data sources
25 # (each item in the list can be either a hashref or an object)
26 my $filled_html = $self->fill_form($html, [$user, $group, $query]);
27
28 # ...or default to getting data from $self->query()
29 my $filled_html = $self->fill_form($html);
30
31 # extra fields will be passed on through:
32 my $filled_html = $self->fill_form($html, undef, fill_password => 0 );
33
34 This method provides an easier syntax for calling HTML::FillInForm, and
35 an intelligent default of using $self->query() as the default data
36 source.
37
38 By default, the mode param (usually 'rm') of every data source will be
39 ignored. This prevents accidently clobbering your run mode for the next
40 page, which may be stored in a hidden field.
41
42 $html must be a scalarref, or a reference to a scalarref. $filled_html
43 will be a reference to a string.
44
45 Because this method only loads HTML::FillInForm if it's needed, it
46 should be reasonable to load it in a base class and always have it
47 available:
48
49 use CGI::Application::Plugin::FillInForm (qw/fill_form/);
50
52 Cees Hek published the first draft on the CGI::App wiki
53 Mark Stosberg, C<< <mark@summersault.com> >> polished it for release.
54 Michael Graham, C<< <mag-perl@occamstoothbrush.com> >> added tests and some new features.
55 The module is now co-maintained by Mark and Michael.
56
58 Please report any bugs or feature requests to
59 "bug-cgi-application-plugin-fillinform@rt.cpan.org", or through the web
60 interface at <http://rt.cpan.org>. I will be notified, and then you'll
61 automatically be notified of progress on your bug as I make changes.
62
64 Patches, questions and feedback are welcome. This project is managed
65 using the darcs source control system ( http://www.darcs.net/ ). My
66 darcs archive is here: http://mark.stosberg.com/darcs_hive/cap-fif/
67
69 Copyright 2005 Mark Stosberg, All Rights Reserved.
70
71 This program is free software; you can redistribute it and/or modify it
72 under the same terms as Perl itself.
73
74
75
76perl v5.34.0 2022-0C1G-I2:0:Application::Plugin::FillInForm(3)