Debian Codegraph @

lib/HTML/FormHandler/Widget/Wrapper/TableInline.pm

raw
1 package HTML::FormHandler::Widget::Wrapper::TableInline;
2 # ABSTRACT: wrapper class for table layout that doesn't wrap compound fields
3 $HTML::FormHandler::Widget::Wrapper::TableInline::VERSION = '0.410002';
4 use Moose::Role;
5 with 'HTML::FormHandler::Widget::Wrapper::Base';
6 use HTML::FormHandler::Render::Util ('process_attrs');
7 use HTML::Entities qw( encode_entities );
8
9 sub wrap_field {
10 my ( $self, $result, $rendered_widget ) = @_;
11
12 return $rendered_widget if $self->has_flag('is_compound');
13
14 my $output = "\n<tr" . process_attrs($self->wrapper_attributes($result)) . ">";
15 if ( $self->do_label && length( $self->label ) > 0 ) {
16 $output .= '<td>' . $self->do_render_label($result) . '</td>';
17 }
18 $output .= '<td>';
19 $output .= $rendered_widget;
20 $output .= qq{\n<span class="error_message">$_</span>}
21 for map { encode_entities($_) } $result->all_errors;
22 $output .= "</td></tr>\n";
23
24 return $output;
25 }
26
27 use namespace::autoclean;
28 1;
29
30 __END__
31
32 =pod
33
34 =encoding UTF-8
35
36 =head1 NAME
37
38 HTML::FormHandler::Widget::Wrapper::TableInline - wrapper class for table layout that doesn't wrap compound fields
39
40 =head1 VERSION
41
42 version 0.410002
43
44 =head1 AUTHOR
45
46 FormHandler Contributors - see HTML::FormHandler
47
48 =head1 COPYRIGHT AND LICENSE
49
50 This software is copyright (c) 2017 by Gerda Shank.
51
52 This is free software; you can redistribute it and/or modify it under
53 the same terms as the Perl 5 programming language system itself.
54
55 =cut