Hello,
This is a run-mode in our sub-class.
################################
sub main_menu
#
#
#
################################
{
# get our primary object
my $self = shift;
# call the CGI::Application 'param()' method
my $conf = $self->param( 'conf' );
my $dbh = $self->param( 'dbh' );
my $session = $self->param( 'session' );
# call the CGI::Application 'query()' method
my $query = $self->query( );
# call some methods on objects we got back from CGI::Application's
'param()' method
my %session = $session->info( );
my $group_id = $query->param( 'group_id' );
my $head = $self->load_tmpl("head1_tmpl.html");
my $body = $self->load_tmpl("main_menu_tmpl.html");
my $foot = $self->load_tmpl("foot1_tmpl.html");
# call that new routine we just added to our super-class (this routine
should be very special!)
unless( $self->our_special_routine( DBH => $dbh ) ) {
die "CRITICAL : our_special_routine failed, $!";
}
}
Methods in the super-class include 'load_tmpl()', 'param()', 'query()', and
'our_special_routine()'. The first three are either defined in the
CGI::Application class, or over-ridden in the CGI::Application super-class
(well, a sub-class of the CGI::Application module, but the super-class of
the module that contains our pretend sub-routine, the consumer of
'our_special_routine()').
Hope that helps,
-- Cory
> -----Original Message-----
> From: Adam Gent [mailto:suppressed
> Sent: Monday, July 07, 2003 4:33 PM
> To: 'CGI::Application mailing list'
> Subject: [cgiapp] Subs in superclass
>
>
> Hi All,
>
> I am wanting to put a sub into the my superclass that I can then call from
> the application modules.
>
> Is this possible, as I can not seem to find anyway to call the sub.
>
> Any ideas?
>
> Thanks.
>
> Adam
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.497 / Virus Database: 296 - Release Date: 05/07/2003
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
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.