Permalink
Browse files

Use the button name for the value when it is the only thing specified

  • Loading branch information...
1 parent 0d42acd commit 0ba95c4b2cbbde4c6c89061e3a55c598811f814f @perlpilot committed Dec 8, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Dancer/Plugin/TTHelpers.pm
@@ -117,7 +117,7 @@ Example:
Example:
-=item C<button([OBJ], NAME, VALUE, [ ATTR ])>
+=item C<button([OBJ], NAME, [VALUE], [ ATTR ])>
Example:
@@ -238,6 +238,7 @@ hook 'before_template' => sub {
my $obj = shift if blessed $_[0];
my $attributes = &process_attributes;
my ($name, $value) = @_;
+ $value //= $name;
return qq(<input type="button" name="$name" value="$value" $attributes />);
};

0 comments on commit 0ba95c4

Please sign in to comment.