On Fri, Oct 03, 2003 at 04:04:01PM -0400, Joel Gwynn wrote:
> Well, the idea is that I want to set a parameter, based on the run-mode,
> in my main container template, which I load in &setup().
Well, you can determine what the runmode will be, based on the same info
cgiapp uses (start_mode & the parameter), but since cgiapp doesn't yet know
what the runmode is, you can't really ask it what the runmode is...
my $rm_param = $self->mode_param() || croak("No rm_param() specified");
my $rm;
# Support call-back instead of CGI mode param
if (ref($rm_param) eq 'CODE') {
# Get run-mode from subref
$rm = $rm_param->($self);
} else {
# Get run-mode from CGI param
$rm = $q->param($rm_param);
}
# If $rm undefined, use default (start) mode
my $def_rm = $self->start_mode() || '';
$rm = $def_rm unless (defined($rm) && length($rm));
This information is available to you. something like:
$rm = $q->param("your param") || 'your start mode'
should do the job, but won't check for valid runmode.
--
SwiftOne / Brett Sanger
suppressed
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.