Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Startup looks like:sub setup { my $self = shift; $self->start_mode('Startup'); $self->tmpl_path('Templates/'); $self->run_modes( 'Startup' => 'Startup', 'Page' => 'Page' # more runmodes here ); };
My quesiton is this, is there a special runmode I can use to initialise appliaction(session) variables without having them in my default runmode so they don't get needlessly redeclared when someone goes back to the main screen?sub Startup { # Startup function my $self = shift; my $q = $self->query(); my $template = $self->load_tmpl('index.tmpl'); $template->param( SITETITLE => "foobarbaz" ); # init more template paramaters and some session variables return $template->output(); # return template results }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application + run modes
by Anonymous Monk on Jul 19, 2011 at 14:04 UTC | |
by Anonymous Monk on Jul 29, 2011 at 14:29 UTC | |
by Anonymous Monk on Jul 29, 2011 at 14:48 UTC | |
by Anonymous Monk on Jul 29, 2011 at 14:52 UTC | |
by Anonymous Monk on Jul 29, 2011 at 15:15 UTC |