Pickles/Plugin/FillInForm.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 3 SCAR 20.8
CC
3
Cov
0%
install
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 8.0
1 package Pickles::Plugin::FillInForm;
2 use strict;
3 use HTML::FillInForm;
4  
5 sub install {
6 my( $class, $pkg ) = @_;
7 $pkg->add_trigger( post_render => sub {
8 my( $c ) = @_;
9 if ( $c->req->method eq 'POST' || $c->stash->{fdat} ) {
10 if ( $c->res->content_type =~ m{^text/x?html}) {
11 my $body = $c->res->body;
12 my $q = $c->stash->{fdat} || $c->req;
13 my $result = HTML::FillInForm->fill( \$body, $q );
14 $c->res->body( $result );
15 }
16 }
17 });
18 }
19  
20 1;
21  
22 __END__