1HTML::FormFu::Deflator:U:sCeormpCoounntdrSipbluitte(d3H)PTeMrLl::DFoocrummFeun:t:aDteifolnator::CompoundSplit(3)
2
3
4
6 HTML::FormFu::Deflator::CompoundSplit - CompoundSplit deflator
7
9 ---
10 element:
11 - type: Multi
12 name: address
13
14 elements:
15 - name: number
16 - name: street
17
18 deflator:
19 - type: CompoundSplit
20
21 # set the default
22
23 $form->get_field('address')->default( $address );
24
26 Deflator to allow you to set several field's values at once.
27
28 For use with a HTML::FormFu::Element::Multi group of fields.
29
30 A default value passed to the Multi field will be split according to
31 the "split" setting, and its resulting parts passed to its child
32 elements.
33
35 split
36 Arguments: $regex
37
38 Default Value: "qr/ +/"
39
40 Regex used to split the default value. Defaults to a regex matching 1
41 or more space characters.
42
43 join
44 Arguments: $string
45
46 Default Value: ' '
47
48 If spliting the value results in more parts than there are fields, any
49 extra parts are joined again to form the value for the last field. The
50 value of "join" is used to join these values.
51
52 Defaults to a single space.
53
54 For example, if the Multi element contains fields "number" and "name",
55 and is given the value "10 Downing Street"; when split this results in
56 3 parts: 10, "Downing" and "Street". In this case, the 1st part, 10 is
57 assigned to the first field, and the 2nd and 3rd parts are re-joined
58 with a space to give the single value "Downing Street", which is
59 assigned to the 2nd field.
60
61 field_order
62 Arguments: \@order
63
64 If the parts from the split value should be assigned to the fields in a
65 different order, you must provide an arrayref containing the names, in
66 the order they should be assigned to.
67
68 ---
69 element:
70 - type: Multi
71 name: address
72
73 elements:
74 - name: street
75 - name: number
76
77 deflator:
78 - type: CompoundSplit
79 field_order:
80 - number
81 - street
82
84 Carl Franks
85
87 This library is free software, you can redistribute it and/or modify it
88 under the same terms as Perl itself.
89
90
91
92perl v5.12.1 2010-H0T5M-L1:6:FormFu::Deflator::CompoundSplit(3)