more tests and moosification

This commit is contained in:
Doug Bell 2009-11-16 18:26:46 -06:00
parent 7ee8fec611
commit 631f6ad267
7 changed files with 109 additions and 72 deletions

View file

@ -119,18 +119,18 @@ Return the HTML for the form
=cut
sub toHtml {
override 'toHtml' => sub {
my ( $self ) = @_;
my @attrs = qw{ action method name enctype };
my $attrs = join " ", map { qq{$_="} . $self->get($_) . qq{"} } @attrs;
my $attrs = join " ", map { qq{$_="} . $self->$_ . qq{"} } grep { $self->$_ } @attrs;
my $html = sprintf '<form %s>', $attrs;
$html .= $self->maybe::next::method;
$html .= super();
$html .= '</form>';
return $html;
}
};
#----------------------------------------------------------------------------