package Class::DBI::AsForm;
use 5.006;
our $VERSION = '2.42';
use strict;
use warnings;
use base 'Exporter';
use Class::DBI::Plugin::Type ();
use HTML::Element;
our $OLD_STYLE = 0;
our @EXPORT = qw( to_cgi to_field _to_textarea _to_textfield _to_select
type_of );
=head1 NAME
Class::DBI::AsForm - Produce HTML form elements for database columns
=head1 SYNOPSIS
package Music::CD;
use Class::DBI::AsForm;
use base 'Class::DBI';
use CGI;
...
sub create_or_edit {
my $class = shift;
my %cgi_field = $class->to_cgi;
return start_form,
(map { "$_: ". $cgi_field{$_}->as_HTML."
" }
$class->Columns),
end_form;
}
#