DiaColloDB-WWW
view release on metacpan or search on metacpan
lib/DiaColloDB/WWW/CGI.pod view on Meta::CPAN
##========================================================================
## DESCRIPTION
=pod
=head1 DESCRIPTION
DiaColloDB::WWW::CGI
provides abstractions and utilities for instantiating
L<Template Toolkit|Template> template files in a CGI-like
environment. It can be used together with the
shared scripts and templates in the F<share/htdocs/> directory of the
L<DiaColloDB::WWW|DiaColloDB::WWW> distribution to create a
CGI-wrapper directory for use with an external web server such as apache
(via L<dcdb-www-create.perl(1)|dcdb-www-create.perl>),
and is implicitly called by the standalone L<DiaColloDB::WWW::Server|DiaColloDB::WWW::Server> class
(see L<dcdb-www-server.perl(1)|dcdb-www-server.perl>).
=cut
##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::WWW::CGI: globals
=pod
=head2 Globals
=over 4
=item Variable: @ISA
DiaColloDB::WWW::CGI
inherits from L<DiaColloDB::Logger|DiaColloDB::Logger>,
and imports the
L<CGI|CGI> C<:standard> and C<:cgi-lib> aliases.
=back
=cut
##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::WWW::CGI: constructors etc.
=pod
=head2 Constructors etc.
=over 4
=item new
$dbcgi = $that->new(%args);
%args, object structure:
##-- Basic Properties
prog => $prog, ##-- handler basename for template resolution & error reporting; default=basename($0)
cgipkg => $cgipkg, ##-- back-end CGI package to use (default='CGI')
##
##-- CGI params
defaults => \%defaults, ##-- default parameter values (default={})
vars => \%vars, ##-- current parameters (after $dbcgi->vars())
charset => $charset, ##-- charset (default='utf-8')
nodecode => \%varnames, ##-- names of variables not to be decoded (default=none)
##
##-- CGI environment stuff : see getenv() method
remote_addr => $remote_addr,
remote_user => $remote_user,
request_method => $request_method,
request_uri => $request_uri,
request_query => $request_query,
http_referer => $http_referer,
http_host => $http_host,
server_addr => $server_addr,
server_port => $server_port,
##
##-- template toolkit stuff
ttk_package => $ttk_package, ##-- package label for template processing (default=ref($dbcgi)||$dbcgi)
ttk_vars => \%ttk_vars, ##-- extra template processing variables (default=$dbcgi->vars())
ttk_config => \%ttk_config, ##-- extra options for Template->new()
ttk_process => \%ttk_process, ##-- extra options for $template->process()
ttk_dir => $ttk_dir, ##-- template toolkit directory (default=abs_path(dirname($0)))
ttk_sharedir=> $ttk_sharedir, ##-- fallback template directory (default=File::ShareDir::dist_dir("DiaColloDB-WWW")."/htdocs")
ttk_key => $ttk_key, ##-- current template basename (default=basename($prog))
ttk_rawkeys => \%ttk_rawkeys ##-- pseudo-set of raw keys (default={profile=>1})
=item _param
@keys = $dbcgi->_param();
$val = $dbcgi->_param($name);
Wraps L<CGI::param()|CGI>.
=item _reset
$dbcgi = $dbcgi->_reset();
resets CGI environment
=item _getenv
$dbcgi = $dbcgi->_getenv();
populate $dbcgi keys from CGI environment variables.
=item fromRequest
$dbcgi = $dbcgi->fromRequest($httpRequest,$csock);
populates $dbcgi keys from an HTTP::Request object,
implicitly calls L<$dbcgi-E<gt>vars()|/vars>.
=item vars
\%vars = $dbcgi->vars();
\%vars = $dbcgi->vars(\%vars);
Get or set CGI variables, instantiating $dbcgi-E<gt>{defaults} if present.
=back
=cut
( run in 1.745 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )