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   136 use strict;
  11         28  
  11         526  
4 11     11   98 use parent 'HTML::Form::SubmitInput';
  11         22  
  11         81  
5              
6             our $VERSION = '6.13';
7              
8             # ABSTRACT: An HTML form image input element for use with HTML::Form
9              
10             sub form_name_value {
11 2     2 0 3 my $self = shift;
12 2         4 my $clicked = $self->{clicked};
13 2 50       6 return unless $clicked;
14 2 50       11 return if $self->{disabled};
15 2         4 my $name = $self->{name};
16 2 100 66     11 $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__