Ok I have a quick question on setup when you're sub classing CGI::App.

If I want to be able to specify standard run modes, and mode_params
without having to overload the setup function each time I use it. How
does that work?

In the super class:

sub setup {
   my $self = shift;

   # get the runmode from the path info.
   $self->mode_param(
       'path_info' => -1
   );

   # Define the default starting runmode (usualy home)
   $self->start_mode('home');

   # Define the runmodes. This maps all the runmodes to functions
   $self->run_modes(
       'home'  =>  'home',
       'user'  =>  'user',
   )
}

In the application

sub setup {
   my $self = shift;

   # Adding this runmode to the standard ones.
   my $self->run_modes(
       'signup' => 'signup'
   );
}

Or should I not even bother to define setup in the super class and
just define it in the sub class each time? What would be the best way
to do this?

Thanks,

Jamie

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to