File Coverage

blib/lib/HTML/Form/ImageInput.pm
Criterion Covered Total %
statement 13 13 100.0
branch 4 6 66.6
condition 2 3 66.6
subroutine 3 3 100.0
pod 0 1 0.0
total 22 26 84.6


line stmt bran cond sub pod time code
1             package HTML::Form::ImageInput;
2              
3 11     11   199 use strict;
  11         23  
  11         353  
4 11     11   58 use parent 'HTML::Form::SubmitInput';
  11         88  
  11         52  
5              
6             our $VERSION = '6.11';
7              
8             # ABSTRACT: An HTML form image input element for use with HTML::Form
9              
10             sub form_name_value {
11 2     2 0 4 my $self = shift;
12 2         5 my $clicked = $self->{clicked};
13 2 50       4 return unless $clicked;
14 2 50       6 return if $self->{disabled};
15 2         3 my $name = $self->{name};
16 2 100 66     10 $name = ( defined($name) && length($name) ) ? "$name." : "";
17             return (
18 2         12 "${name}x" => $clicked->[0],
19             "${name}y" => $clicked->[1]
20             );
21             }
22              
23             1;
24              
25             __END__