File Coverage

lib/HTML/FormWidgets/RadioGroup.pm
Criterion Covered Total %
statement 23 23 100.0
branch 3 6 50.0
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 33 36 91.6


line stmt bran cond sub pod time code
1             package HTML::FormWidgets::RadioGroup;
2              
3 1     1   680 use strict;
  1         2  
  1         24  
4 1     1   5 use warnings;
  1         2  
  1         24  
5 1     1   5 use parent 'HTML::FormWidgets';
  1         1  
  1         6  
6              
7             __PACKAGE__->mk_accessors( qw( columns labels values ) );
8              
9             sub init {
10 1     1 1 2    my ($self, $args) = @_;
11              
12 1         4    $self->columns( undef );
13 1         6    $self->labels ( undef );
14 1         7    $self->values ( [] );
15 1         6    return;
16             }
17              
18             sub render_field {
19 1     1 1 3    my ($self, $args) = @_; my $hacc = $self->hacc;
  1         4  
20              
21 1         5    $args->{label_class} = q(radio_group);
22 1 50       4    $args->{columns } = $self->columns if ($self->columns);
23 1 50       11    $args->{labels } = $self->labels if ($self->labels);
24 1 50       13    $args->{onchange } = $self->onchange if ($self->onchange);
25 1         7    $args->{values } = $self->values;
26              
27 1         8    my $html = $hacc->radio_group( $args );
28              
29 1         186    return $hacc->div( { class => q(checkbox_container) }, $html );
30             }
31              
32             1;
33              
34             # Local Variables:
35             # mode: perl
36             # tab-width: 3
37             # End:
38