Catalyst::Plugin::OrderedParams - Maintain order of submitted form parameters


Catalyst-Plugin-OrderedParams documentation  | view source Contained in the Catalyst-Plugin-OrderedParams distribution.

Index


NAME

Top

Catalyst::Plugin::OrderedParams - Maintain order of submitted form parameters

SYNOPSIS

Top

    use Catalyst;
    MyApp->setup( qw/OrderedParams/ );

DESCRIPTION

Top

This plugin enables handling of GET and POST parameters in an ordered fashion. By default in Catalyst, form parameters are stored in a simple hash, which loses the original order in which the parameters were submitted. This plugin stores parameters in a Tie::IxHash which will retain the original submitted order.

One particular application for this plugin is email handlers, where you want the output of your email to reflect the order of form elements in the form.

Simply add this plugin to your application and the following code will be in the proper order.

    for my $param ( $c->req->param ) {
        $email .= $param . ": " . $c->req->param( $param );
    }

CAVEATS

Top

Note that technically according to RFC2388, the ordering of fields submitted by a form does not have to follow the order of the form elements displayed on the page. However, I believe most, if not all, common browsers do follow this convention. This plugin has been tested with both IE6 and Firefox 1.0.6.

SEE ALSO

Top

Catalyst

AUTHOR

Top

Andy Grundman, <andy@hybridized.org>

THANKS

Top

Tom Shinnick, shenme@perlmonks.org, for pointing out RFC2388.

COPYRIGHT

Top


Catalyst-Plugin-OrderedParams documentation  | view source Contained in the Catalyst-Plugin-OrderedParams distribution.