| 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.410002'; |
| 4 |
use Moose; |
| 5 |
extends 'HTML::FormHandler::Widget::Block'; |
| 6 |
|
| 7 |
has 'after_controls' => ( is => 'rw' ); |
| 8 |
|
| 9 |
sub BUILD { |
| 10 |
my $self = shift; |
| 11 |
$self->add_class('control-group'); |
| 12 |
$self->add_label_class('control-label'); |
| 13 |
$self->label_tag('label'); |
| 14 |
} |
| 15 |
|
| 16 |
sub render_from_list { |
| 17 |
my ( $self, $result ) = @_; |
| 18 |
$result ||= $self->form->result; |
| 19 |
my $output = $self->next::method($result); |
| 20 |
my $after_controls = $self->after_controls || ''; |
| 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.410002 |
| 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 |