| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package HTML::FormHandler::Widget::Field::ButtonTag; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: button field rendering widget, using button tag |
|
3
|
|
|
|
|
|
|
$HTML::FormHandler::Widget::Field::ButtonTag::VERSION = '0.40068'; |
|
4
|
6
|
|
|
6
|
|
4529
|
use Moose::Role; |
|
|
6
|
|
|
|
|
18
|
|
|
|
6
|
|
|
|
|
62
|
|
|
5
|
6
|
|
|
6
|
|
31559
|
use namespace::autoclean; |
|
|
6
|
|
|
|
|
18
|
|
|
|
6
|
|
|
|
|
76
|
|
|
6
|
6
|
|
|
6
|
|
586
|
use HTML::FormHandler::Render::Util ('process_attrs'); |
|
|
6
|
|
|
|
|
20
|
|
|
|
6
|
|
|
|
|
67
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
0
|
0
|
sub html_element { 'button' } |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub render_element { |
|
11
|
13
|
|
|
13
|
0
|
33
|
my ( $self, $result ) = @_; |
|
12
|
13
|
|
33
|
|
|
46
|
$result ||= $self->result; |
|
13
|
|
|
|
|
|
|
|
|
14
|
13
|
|
|
|
|
119
|
my $output = '<button type="' . $self->input_type . '" name="' |
|
15
|
|
|
|
|
|
|
. $self->html_name . '" id="' . $self->id . '"'; |
|
16
|
13
|
|
|
|
|
89
|
$output .= process_attrs($self->element_attributes($result)); |
|
17
|
13
|
|
|
|
|
49
|
$output .= '>'; |
|
18
|
13
|
|
|
|
|
429
|
$output .= $self->_localize($self->value); |
|
19
|
13
|
|
|
|
|
39
|
$output .= "</button>"; |
|
20
|
13
|
|
|
|
|
43
|
return $output; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub render { |
|
24
|
13
|
|
|
13
|
0
|
45
|
my ( $self, $result ) = @_; |
|
25
|
13
|
|
33
|
|
|
47
|
$result ||= $self->result; |
|
26
|
13
|
50
|
|
|
|
42
|
die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; |
|
27
|
13
|
|
|
|
|
61
|
my $output = $self->render_element( $result ); |
|
28
|
13
|
|
|
|
|
79
|
return $self->wrap_field( $result, $output ); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
HTML::FormHandler::Widget::Field::ButtonTag - button field rendering widget, using button tag |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 0.40068 |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
FormHandler Contributors - see HTML::FormHandler |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Gerda Shank. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
57
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |