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.40067';
4 1     1   774 use Moose;
  1         1  
  1         8  
5             extends 'HTML::FormHandler::Widget::Block';
6              
7             has 'after_controls' => ( is => 'rw' );
8              
9             sub BUILD {
10 2     2 0 2684 my $self = shift;
11 2         73 $self->add_class('control-group');
12 2         71 $self->add_label_class('control-label');
13 2         56 $self->label_tag('label');
14             }
15              
16             sub render_from_list {
17 2     2 0 2 my ( $self, $result ) = @_;
18 2   33     7 $result ||= $self->form->result;
19 2         10 my $output = $self->next::method($result);
20 2   50     83 my $after_controls = $self->after_controls || '';
21 2         21 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.40067
39              
40             =head1 AUTHOR
41              
42             FormHandler Contributors - see HTML::FormHandler
43              
44             =head1 COPYRIGHT AND LICENSE
45              
46             This software is copyright (c) 2016 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