.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "HTML::FormHandler::Manual::FromDFV 3pm" .TH HTML::FormHandler::Manual::FromDFV 3pm "2017-11-11" "perl v5.26.1" "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" HTML::FormHandler::Manual::FromDFV \- converting from Data::FormValidator .SH "VERSION" .IX Header "VERSION" version 0.40068 .SH "SYNOPSIS" .IX Header "SYNOPSIS" Manual Index .PP Cheatsheet for converting from Data::FormValidator. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Information that's useful when switching from Data::FormValidator to HTML::FormHandler. There's not a lot here yet, so if you have something to add, patches are welcome. .PP In a general way, FormHandler doesn't have nearly so many \*(L"special\*(R" checks as Data::FormValidator. It would be possible to implement many of them, but there hasn't been much demand for them. So far FormHandler users seem to be satisfied with the \*(L"do your own checks in a Perl method\*(R" solution. Because of the greater complexity of FormHandler's data model \- with Repeatable arrays and nested compounds, etc \- it's somewhat harder to do some of them automatically. .SH "Differences/conversions" .IX Header "Differences/conversions" .IP "dependencies" 4 .IX Item "dependencies" In FormHandler, 'dependency' is the equivalent of 'dependency_group', without the key names. .Sp The other variations of dependencies in \s-1DFV\s0 are not implemented in FormHandler, and would normally be done in a form's 'validate' sub. .IP "trim, filters" 4 .IX Item "trim, filters" A 'trim' filter is installed by default in FormHandler; it's a special version of an apply action, and can be set to a transform or Moose type. See the documentation in HTML::FormHandler::Field#trim. .Sp Transforms and inflations/deflations do not change what is presented in the form unless you set the 'fif_from_value' flag on the field. .IP "FV_length_between, FV_max_length, FV_min_length" 4 .IX Item "FV_length_between, FV_max_length, FV_min_length" Use text fields with 'minlength' and 'maxlength' attributes. .IP "FV_eq_with" 4 .IX Item "FV_eq_with" Perform your own checks in the form 'validate' sub. .Sp .Vb 5 \& sub validate { \& my $self = shift; \& if( $self\->field(\*(Aqone\*(Aq)\->value eq $self\->field(\*(Aqtwo\*(Aq)\->value ) { \& } \& } .Ve .SH "Constraints" .IX Header "Constraints" The simple constraints from Data::FormValidator::Constraints can be used directly in a FormHandler form: .PP .Vb 3 \& use Data::FormValidator::Constraints (\*(Aqmatch_state\*(Aq); \& has_field \*(Aqmy_state\*(Aq => ( \& apply => [ { check => \e&match_state, message => \*(AqInvalid State\*(Aq } ] ); .Ve .IP "email" 4 .IX Item "email" Use the 'Email' field type, or use the \s-1FH\s0 Moose Type, 'email'. .Sp .Vb 4 \& has_field \*(Aqemail\*(Aq => ( type => \*(AqEmail\*(Aq ); \& \-\- or \-\- \& use HTML::FormHandler::Types (\*(AqEmail\*(Aq); \& has_field \*(Aqemail\*(Aq => ( apply => [ Email ] ); .Ve .SH "AUTHOR" .IX Header "AUTHOR" FormHandler Contributors \- see HTML::FormHandler .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Gerda Shank. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.