lib/HTML/FormFu/Element/Radiogroup.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 29 / 29 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/HTML/FormFu/Element/Radio.pm ↑ Summary lib/HTML/FormFu/Element/Reset.pm »
1 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Element::Radiogroup;
4 18 $HTML::FormFu::Element::Radiogroup::VERSION = '2.06';
5 # ABSTRACT: Group of radiobutton form fields
6  
7 18 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 18 ▶use MooseX::Attribute::Chained;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 18 extends 'HTML::FormFu::Element::Checkboxgroup';
10  
11 18 ▶use HTML::FormFu::Constants qw( $EMPTY_STR );
Subroutine BEGIN: called CC=1 SCAR=0.0
12 18 ▶use HTML::FormFu::Util qw( append_xml_attribute process_attrs );
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 after BUILD => sub {
15 30 ▶ my $self = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
16  
17 30 $self->input_type('radio');
18  
19 30 return;
20 18 };
21  
22 18 __PACKAGE__->meta->make_immutable;
23  
24 18 1;
25  
26 __END__
27  
28 =pod
29  
30 =encoding UTF-8
31  
32 =head1 NAME
33  
34 HTML::FormFu::Element::Radiogroup - Group of radiobutton form fields
35  
36 =head1 VERSION
37  
38 version 2.06
39  
40 =head1 SYNOPSIS
41  
42 YAML config:
43  
44 ---
45 elements:
46 - type: Radiogroup
47 name: sex
48 options:
49 - [ 'm', 'Male' ]
50 - [ 'f', 'Female' ]
51  
52 =head1 DESCRIPTION
53  
54 Convenient to use group of radio button fields.
55  
56 Use the same syntax as you would to create a Select element optgroup to
57 create RadioGroup sub-groups, see L<HTML::FormFu::Role::Element::Group/options>
58 for details.
59  
60 =head1 METHODS
61  
62 =head2 options
63  
64 See L<HTML::FormFu::Role::Element::Group/options>.
65  
66 =head2 values
67  
68 See L<HTML::FormFu::Role::Element::Group/values>.
69  
70 =head2 value_range
71  
72 See L<HTML::FormFu::Role::Element::Group/value_range>.
73  
74 =head2 empty_first
75  
76 See L<HTML::FormFu::Role::Element::Group/empty_first>.
77  
78 =head2 auto_id
79  
80 In addition to the substitutions documented by L<HTML::FormFu/auto_id>,
81 C<%c> will be replaced by an incremented integer, to ensure there are
82 no duplicated ID's.
83  
84 ---
85 elements:
86 type: Radiogroup
87 name: foo
88 auto_id: "%n_%c"
89  
90 =head2 reverse_group
91  
92 See L<HTML::FormFu::Element::Checkboxgroup/reverse_group>.
93  
94 =head1 DEPRECATED METHODS
95  
96 =head2 radiogroup_filename
97  
98 =head1 SEE ALSO
99  
100 Is a sub-class of, and inherits methods from
101 L<HTML::FormFu::Element::Checkboxgroup>,
102 L<HTML::FormFu::Role::Element::Group>,
103 L<HTML::FormFu::Role::Element::Field>,
104 L<HTML::FormFu::Element>
105  
106 L<HTML::FormFu>
107  
108 =head1 AUTHOR
109  
110 Carl Franks, C<cfranks@cpan.org>
111  
112 =head1 LICENSE
113  
114 This library is free software, you can redistribute it and/or modify it under
115 the same terms as Perl itself.
116  
117 =head1 AUTHOR
118  
119 Carl Franks <cpan@fireartist.com>
120  
121 =head1 COPYRIGHT AND LICENSE
122  
123 This software is copyright (c) 2018 by Carl Franks.
124  
125 This is free software; you can redistribute it and/or modify it under
126 the same terms as the Perl 5 programming language system itself.
127  
128 =cut
« lib/HTML/FormFu/Element/Radio.pm ↑ Summary lib/HTML/FormFu/Element/Reset.pm »