File Coverage

blib/lib/HTML/FormHandler/Widget/Block/Bootstrap.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition 2 5 40.0
subroutine 3 3 100.0
pod 0 2 0.0
total 17 22 77.2


line stmt bran cond sub pod time code
1             package HTML::FormHandler::Widget::Block::Bootstrap;
2             # ABSTRACT: block to format bare form element like bootstrap
3             $HTML::FormHandler::Widget::Block::Bootstrap::VERSION = '0.40068';
4 1     1   737 use Moose;
  1         3  
  1         8  
5             extends 'HTML::FormHandler::Widget::Block';
6              
7             has 'after_controls' => ( is => 'rw' );
8              
9             sub BUILD {
10 2     2 0 2616 my $self = shift;
11 2         75 $self->add_class('control-group');
12 2         74 $self->add_label_class('control-label');
13 2         59 $self->label_tag('label');
14             }
15              
16             sub render_from_list {
17 2     2 0 6 my ( $self, $result ) = @_;
18 2   33     7 $result ||= $self->form->result;
19 2         12 my $output = $self->next::method($result);
20 2   50     66 my $after_controls = $self->after_controls || '';
21 2         18 return qq{<div class="controls">\n$output\n$after_controls\n</div>\n};
22             }
23              
24             1;
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             HTML::FormHandler::Widget::Block::Bootstrap - block to format bare form element like bootstrap
35              
36             =head1 VERSION
37              
38             version 0.40068
39              
40             =head1 AUTHOR
41              
42             FormHandler Contributors - see HTML::FormHandler
43              
44             =head1 COPYRIGHT AND LICENSE
45              
46             This software is copyright (c) 2017 by Gerda Shank.
47              
48             This is free software; you can redistribute it and/or modify it under
49             the same terms as the Perl 5 programming language system itself.
50              
51             =cut