.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::FormFu::Deflator::CompoundSplit 3pm" .TH HTML::FormFu::Deflator::CompoundSplit 3pm 2024-04-10 "perl v5.38.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 HTML::FormFu::Deflator::CompoundSplit \- CompoundSplit deflator .SH VERSION .IX Header "VERSION" version 2.07 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 4 \& \-\-\- \& element: \& \- type: Multi \& name: address \& \& elements: \& \- name: number \& \- name: street \& \& deflator: \& \- type: CompoundSplit \& \& # set the default \& \& $form\->get_field(\*(Aqaddress\*(Aq)\->default( $address ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Deflator to allow you to set several field's values at once. .PP For use with a HTML::FormFu::Element::Multi group of fields. .PP A default value passed to the Multi field will be split according to the "split" setting, and its resulting parts passed to its child elements. .SH METHODS .IX Header "METHODS" .SS split .IX Subsection "split" Arguments: \f(CW$regex\fR .PP Default Value: \f(CW\*(C`qr/ +/\*(C'\fR .PP Regex used to split the default value. Defaults to a regex matching 1 or more space characters. .SS join .IX Subsection "join" Arguments: \f(CW$string\fR .PP Default Value: \f(CW\*(Aq \*(Aq\fR .PP If splitting the value results in more parts than there are fields, any extra parts are joined again to form the value for the last field. The value of "join" is used to join these values. .PP Defaults to a single space. .PP For example, if the Multi element contains fields \f(CW\*(C`number\*(C'\fR and \f(CW\*(C`name\*(C'\fR, and is given the value \f(CW\*(C`10 Downing Street\*(C'\fR; when split this results in 3 parts: \f(CW10\fR, \f(CW\*(C`Downing\*(C'\fR and \f(CW\*(C`Street\*(C'\fR. In this case, the 1st part, \f(CW10\fR is assigned to the first field, and the 2nd and 3rd parts are re-joined with a space to give the single value \f(CW\*(C`Downing Street\*(C'\fR, which is assigned to the 2nd field. .SS field_order .IX Subsection "field_order" Arguments: \e@order .PP If the parts from the split value should be assigned to the fields in a different order, you must provide an arrayref containing the names, in the order they should be assigned to. .PP .Vb 4 \& \-\-\- \& element: \& \- type: Multi \& name: address \& \& elements: \& \- name: street \& \- name: number \& \& deflator: \& \- type: CompoundSplit \& field_order: \& \- number \& \- street .Ve .SH AUTHOR .IX Header "AUTHOR" Carl Franks .SH LICENSE .IX Header "LICENSE" This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. .SH AUTHOR .IX Header "AUTHOR" Carl Franks .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018 by Carl Franks. .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.