CGI::Snapp::Plugin::Forward

A plugin for CGI::Snapp to switch cleanly to another run mode within the same app
Download

CGI::Snapp::Plugin::Forward Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ron Savage
  • Publisher web site:
  • http://search.cpan.org/~rsavage/

CGI::Snapp::Plugin::Forward Tags


CGI::Snapp::Plugin::Forward Description

When you 'use' the CGI::Snapp::Plugin::Forward Perl module in your sub-class of CGI::Snapp (as in the Synopsis), it automatically imports into your sub-class the "forward($run_mode)" method, to give you a single call to switch run modes and run a hook before entering the new run mode. See that method's details below for exactly what effect a call to forward() has.If you want to redirect to another (external) url, then CGI::Snapp::Plugin::Redirect's redirect() method is more suitable.Synopsis package My::App; use parent 'CGI::Snapp'; use CGI::Snapp::Plugin::Forward; # ------------------------------------------------ sub setup { my($self) = @_; $self -> run_modes(); } # ------------------------------------------------ sub start { my($self) = @_; my($rm) = $self -> get_current_runmode; # 'start'. return $self -> forward('second', 'some', 'data'); } # ------------------------------------------------ sub second { my($self, @args) = @_; my($rm) = $self -> get_current_runmode; # 'second'. return $html; } # ------------------------------------------------ 1;Product's homepage


CGI::Snapp::Plugin::Forward Related Software