The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Plugin::Redirect::Body - Output of redirect screen etc.

SYNOPSIS

  use Egg qw/ Redirect::Body /;
  
  __PACKAGE__->egg_startup(
  
    plugin_redirect => {
      default_url  => '/',
      default_wait => 0,
      default_msg  => 'Processing was completed.',
      style => {
        body => ' ..... ',
        h1   => ' ..... ',
        div  => ' ..... ',
        },
      },
  
    );

  # redirect screen is output and processing is ended.
  $e->redirect_body('/hoge_page', 'complete ok.', alert => 1 );
  
  # The HTML source of redirect screen is acquired.
  my $html= $e->redirect_body_source('/hoge_page', 'complete ok.', alert => 1 );

DESCRIPTION

It is a plugin concerning an easy screen display at redirect.

CONFIGURATION

This plugin is setup by the item name 'plugin_redirect'.

default_url => [DEFAULT_URL]

URL when 'url' is unspecified.

Default is '/'.

default_wait => [WAIT_TIME]

redirect waiting time when 'wait' is unspecified.

Default is 0,

default_mag => [REDIRECT_MESSAGE]

Default when redirect message is unspecified.

Default is 'Processing was completed.'.

style => [HASH]

The screen style is set with HASH.

  • body => [BODY_STYLE]

    The entire basic setting of screen.

     Default:
       background  : #FFEDBB;
       text-align  : center;
  • h1 => [H1_STYLE]

    Style of <h1>.

     Default:
       font        : bold 20px sans-serif;
       margin      : 0px;
       margin-left : 0px;'.
  • div => [DIV_STYLE]

    Style of <div>.

     Default:
       background  : #FFF7ED;
       padding     : 10px;
       margin      : 50px;
       font        : normal 12px sans-serif;
       border      : #D15C24 solid 3px;
       text-align  : left;

METHODS

redirect_body_source ( [URL], [MESSAGE], [ARGS_HASH] )

The HTML source of redirect screen is returned.

When URL is omitted, a set value of 'default_url' is used.

When MESSAGE is omitted, a set value of 'default_msg' is used.

The following items can be passed to ARGS_HASH.

  • wait => [WAIT_TIME]

    redirect waiting time. The value of default_wait is used when omitted.

      $e->redirect_body_source(0, 0, wait => 1 );
  • alert => [BOOL]

    The script concerning alert of the JAVA script is built in.

      $e->redirect_body_source(0, 0, alert => 1 );
  • onload_func => [ONLOAD_FUNCTION]

    onload is added to <body> when given.

      $e->redirect_body_source(0, 0, onload_func => 'onload_script()' );
  • body_style => [STYLE]

    The setting of plugin_redirect->{style}{body} is overwrited when given.

  • h1_style => [STYLE]

    The setting of plugin_redirect->{style}{h1} is overwrited when given.

  • div_style => [STYLE]

    The setting of plugin_redirect->{style}{div} is overwrited when given.

redirect_body ( [URL], [MESSAGE], [ARGS_HASH] )

$e->response->redirect is setup. And, 'redirect_body_source' is set in $e->response->body.

The argument is passed to redirect_body_source as it is.

SEE ALSO

Egg::Response, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.