File Coverage

blib/lib/HTML/FormHandler/Widget/Wrapper/Fieldset.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package HTML::FormHandler::Widget::Wrapper::Fieldset;
2             # ABSTRACT: fieldset field wrapper
3             $HTML::FormHandler::Widget::Wrapper::Fieldset::VERSION = '0.40067';
4 1     1   725 use Moose::Role;
  1         1  
  1         10  
5 1     1   3748 use namespace::autoclean;
  1         1  
  1         8  
6              
7             with 'HTML::FormHandler::Widget::Wrapper::Base';
8 1     1   72 use HTML::FormHandler::Render::Util ('process_attrs');
  1         2  
  1         8  
9              
10              
11             sub wrap_field {
12 3     3 0 7 my ( $self, $result, $rendered_widget ) = @_;
13              
14 3         15 my $wattrs = process_attrs($self->wrapper_attributes);
15 3         12 my $output .= qq{\n<fieldset$wattrs>};
16 3         20 $output .= qq{\n<legend>} . $self->loc_label . '</legend>';
17              
18 3         10 $output .= "\n$rendered_widget";
19              
20             $output .= qq{\n<span class="error_message">$_</span>}
21 3         125 for $result->all_errors;
22 3         9 $output .= "\n</fieldset>";
23              
24 3         32 return $output;
25             }
26              
27             1;
28              
29             __END__
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             HTML::FormHandler::Widget::Wrapper::Fieldset - fieldset field wrapper
38              
39             =head1 VERSION
40              
41             version 0.40067
42              
43             =head1 SYNOPSIS
44              
45             Wraps a single field in a fieldset.
46              
47             =head1 NAME
48              
49             HTML::FormHandler::Widget::Wrapper::Fieldset - fieldset field wrapper
50              
51             =head1 AUTHOR
52              
53             FormHandler Contributors - see HTML::FormHandler
54              
55             =head1 COPYRIGHT AND LICENSE
56              
57             This software is copyright (c) 2016 by Gerda Shank.
58              
59             This is free software; you can redistribute it and/or modify it under
60             the same terms as the Perl 5 programming language system itself.
61              
62             =cut