|
::Features
::Download
::Tutorial
::Examples
::Documentation ::FormBuilder Google Group ::Old List Archives ::Contribute |
|
Intermediate Tutorial - Step 9: Modules & mod_perl
FormBuilder is designed to work well alone, alongside other modules, or
even in a
The key to interacting with any of these situations is the
However, when you're already using
First, using FormBuilder with
#!/usr/bin/perl
use CGI;
use CGI::FormBuilder;
$query = new CGI;
$form = CGI::FormBuilder->new(
method => 'post',
fields => [qw/name email zipcode/],
params => $query
);
print $form->render;
Second, using FormBuilder under mod_perl
package My::Application; # or whatever
use Apache::Request;
use CGI::FormBuilder;
sub handler {
my $r = Apache::Request->new(shift);
my $form = CGI::FormBuilder->new(
method => 'post',
fields => [qw/name email zipcode/],
params => $r
);
print $form->render;
}
In both situations, the only thing that you have to add is the params
option. Everything else about FormBuilder stays the same.
Finally, note that the |
| FormBuilder is © Nate Wiger, with contributions from many people. |