.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Catalyst::Plugin::FillInForm 3pm" .TH Catalyst::Plugin::FillInForm 3pm "2009-07-11" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Plugin::FillInForm \- FillInForm for Catalyst .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Catalyst \*(AqFillInForm\*(Aq; \& # that\*(Aqs it, if Catalyst::Plugin::FormValidator is being used \& \& # OR, manually: \& \& # in Controller/Root.pm; assume $c\->stash\->data is seeded elsewhere \& sub end : Private { \& my ( $self, $c ) = @_; \& $c\->forward(\*(AqMyApp::View::TT\*(Aq) unless $c\->res\->output; \& $c\->fillform( $c\->stash\->data ); \& # .... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Fill forms automatically, based on data from a previous \s-1HTML\s0 form. Typically (but not necessarily) used in conjunction with Catalyst::Plugin::FormValidator. This module automatically inserts data from a previous \s-1HTML\s0 form into \s-1HTML\s0 input fields, textarea fields, radio buttons, checkboxes, and select tags. It is an instance of HTML::FillInForm, which itself is a subclass of HTML::Parser, which it uses to parse the \&\s-1HTML\s0 and insert the values into the proper form tags. .PP The usual application is after a user submits an \s-1HTML\s0 form without filling out a required field, or with errors in fields having specified constraints. FillInForm is used to redisplay the \s-1HTML\s0 form with all the form elements containing the submitted info. FillInForm can also be used to fill forms with data from any source, e.g. directly from your database. .SS "\s-1EXTENDED\s0 \s-1METHODS\s0" .IX Subsection "EXTENDED METHODS" \fIfinalize\fR .IX Subsection "finalize" .PP Will automatically fill in forms, based on the parameters in \&\f(CW\*(C`$c\->req\->parameters\*(C'\fR, if the last form has missing or invalid fields, and if \f(CW\*(C`Catalyst::Plugin::FormValidator\*(C'\fR is being used. \f(CW\*(C`finalize\*(C'\fR is called automatically by the Catalyst Engine; the end user will not have to call it directly. (In fact, it should never be called directly by the end user.) .SS "\s-1METHODS\s0" .IX Subsection "METHODS" \fIfillform\fR .IX Subsection "fillform" .PP Fill a form, based on request parameters (the default) or any other specified data hash. You would call this manually if you're getting your data from some source other than the parameters (e.g. if you're seeding an edit form with the results of a database query), or if you're using some other validation system than \f(CW\*(C`Catalyst::Plugin::FormValidator\*(C'\fR. .PP .Vb 1 \& $c\->fillform; # defaults to $c\->req\->parameters \& \& # OR \& \& $c\->fillform( \e%data_hash ); .Ve .PP \&\f(CW\*(C`fillform\*(C'\fR must be called after an \s-1HTML\s0 template has been rendered. A typical way of using it is to place it immediately after your \f(CW\*(C`forward\*(C'\fR call to your view class, which might be in a built-in \f(CW\*(C`end\*(C'\fR action in your application class. .PP You can also hand in a hashref of additional params for HTML::FillInForm\->\fIfill()\fR if you like. Explicitly providing a \&\e%data_hash is mandatory for this use case. .PP .Vb 4 \& $c\->fillform( $c\->req\->parameters, { \& ignore_fields => [ \*(Aqpagesrc\*(Aq, \*(Aqpagedst\*(Aq ], \& fill_password => 0, \& } ); .Ve .SH "NOTES" .IX Header "NOTES" This class does not play well with Catalyst's ActionClass('RenderView') so you may want to check your \f(CW\*(C`end\*(C'\fR method (in Controller/Root.pm or perhaps MyApp.pm). If it looks like this: .PP .Vb 1 \& sub end : ActionClass(\*(AqRenderView\*(Aq) {} .Ve .PP Then you'll need to change it to something like this: .PP .Vb 5 \& sub end : Private { \& my ($self, $c) = @_; \& $c\->forward(\*(Aqrender\*(Aq); \& $c\->fillform($c\->req\->params) unless $c\->res\->output; \& } \& \& sub render : ActionClass(\*(AqRenderView\*(Aq) { } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Catalyst, Catalyst::Plugin::FormValidator, HTML::FillInForm, Catalyst::Action::RenderView. .SH "AUTHOR" .IX Header "AUTHOR" Sebastian Riedel, \f(CW\*(C`sri@cpan.org\*(C'\fR Marcus Ramberg, \f(CW\*(C`mramberg@cpan.org\*(C'\fR Jesse Sheidlower, \f(CW\*(C`jester@panix.com\*(C'\fR Jay Hannah, \f(CW\*(C`jay@jays.net\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.