[cgiapp] one question about the plugin: CGI::Appliclation::Plugin::AutoRunmode

Mike.G hylinux at gmail.com
Tue Jun 10 02:45:02 EDT 2008


thanks


2008/6/4 Alexandr Ciornii <alexchorny at gmail.com>:

> Hello!
>
> sub run_mode_1:Runmode
>  is an equivalent of
> $this->run_modes ( 'run_mode_1' => 'run_mode_1',
>
> To have run mode 'mode_1' you need
> sub mode_1:Runmode
>
> StartRunmode also adds
> $this->start_mode('...')
>
> To change mode_param, do it as before in setup {}.
>
> Also see SYNOPSIS from CGI::Application::Plugin::AutoRunmode docs
> (http://search.cpan.org/perldoc?CGI::Application::Plugin::AutoRunmode).
>
> 2008/6/4 Mike. G <hylinux at gmail.com>:
> > Hi, everybody.
> >
> > when I use CGI::Application like this:
> >
> > package MyWeb;
> > use base qw/CGI::Application/;
> >
> > sub setup {
> >     my $this = shift;
> >
> >     $this->run_modes (
> >         'mode_1' => 'run_mode_1',
> >         ......
> >     }
> >
> >     $this->start_mode('mode_1')
> >     $this->mode_param('action')
> >
> >
> >
> > }
> >
> > ......
> >
> > 1;
> >
> > so in my url, we can request the script like this:
> > http://127.0.0.1/cgi/test.pl?action=mode_1
> >
> > but when I use that plugin
> >
> > I will write code like this:
> >
> > package MyWeb;
> > use base qw/CGI::Application/;
> > use CGI::Application::Plugin::AutoRunmode;
> >
> > sub run_mode_1:StartMode {
> >   ......
> > }
> >
> > 1;
> >
> > so my issue is: when I use that plugin, what's that parameter( I had
> > request, named 'action' in example1? it is run_mode_1? )?
>
> --
> Alexandr Ciornii, http://chorny.net
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list