X-Git-Url: http://git.shiar.net/perl/html-form-simple.git/blobdiff_plain/d74d61d638a9f0c83f3860de02225c16309ccf2d..bb5bd81e03c47ff9cc779c5109bd6e042219a1f8:/lib/HTML/Form/Simple.pm diff --git a/lib/HTML/Form/Simple.pm b/lib/HTML/Form/Simple.pm index bbeb6b6..3a58c79 100644 --- a/lib/HTML/Form/Simple.pm +++ b/lib/HTML/Form/Simple.pm @@ -76,6 +76,11 @@ sub hidden { return wantarray ? @return : join(defined $, ? $, : '', @return); } + if (ref $value eq 'ARRAY') { + my @return = map { $self->hidden($name, $_, $attr) } @$value; + return wantarray ? @return : join(defined $, ? $, : '', @return); + } + $attr->{name } = $name if defined $name; $attr->{value} = $value if defined $value; $attr->{type} = 'hidden' unless defined $attr->{type}; @@ -83,7 +88,7 @@ sub hidden { return $self->tag(input => $attr); } -sub input { +sub text { my $self = shift; my ($name, $value, $attr) = $self->_attr(2, @_); @@ -205,7 +210,7 @@ sub check { =head1 NAME -HTML::Form::Simple +HTML::Form::Simple - Generate HTML form elements =head1 SYNOPSIS @@ -230,3 +235,12 @@ HTML::Form::Simple ); say $input->stop; # +=head1 AUTHOR + +Mischa POSLAWSKY + +=head1 LICENSE + +This module is free software; you can redistribute it and/or modify it +under the same L as Perl itself. +