package Apache2::Request::Plus; use strict; use Debug::ShowStuff ':all'; use String::Util ':all'; use Apache2::RequestUtil; use base 'Apache2::Request'; # version use vars '$VERSION'; $VERSION = '0.10'; =head1 NAME Apache2::Request::Plus -- A few extra features added to Apache2::Request. =head1 SYNOPSIS use Apache2::Request::Plus; my $r = Apache2::Request::Plus->new(); # anything you can already do with Apache2::Request $r->content_type('text/html'); $r->headers_out->set('charset' => 'ISO-8859-1'); # was the form submitted (as opposed to just a request sent)? if ($r->form_sent) { # stuff } =head1 DESCRIPTION The original purpose of Apache2::Request::Plus was to make a mod_perl request object that had some of the features of an old school CGI.pm object. An object of this class gives the request object some methods like textfield() and popup_menu() which you may be used to from CGI.pm Since its creation this module has also some other convenient methods for creating and processing web forms. =head1 INSTALLATION Apache2::Request::Plus can be installed with the usual routine: perl Makefile.PL make make test make install =head1 Paradigm: submit to self and form_sent The methods in this module are built around the idea that the web page form submits back to itself. That is, the form's action is the current page. The methods detect if the request was submitted by the form (as opposed to a request from some other source) by looking for a request parameter called "form_sent". By defaul the C<$r->form_open()> method adds a hidden field with the name "form_sent" and the value "1". =head1 METHODS =cut #------------------------------------------------------------------------------ # new # =head2 Apache2::Request::Plus->new() Instantiates a new Apache2::Request::Plus object. No parameters needed or used. =cut sub new { my ($class) = @_; my $r = Apache2::Request->new(Apache2::RequestUtil->request()); bless $r, $class; return $r; } # # new #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # formopen # =head2 $r->formopen() Returns a