Class::DBI::Plugin::HTML is Perl module to generate HTML Tables and Forms in conjunction with Class::DBI.
SYNOPSIS
# Inside of your sub-class of Class::DBI add these lines:
use Class::DBI::Plugin::HTML;
use Class::DBI::Pager;
use Class::DBI::AbstractSearch;
use Class::DBI::Plugin::AbstractCount;
use Class::DBI::Plugin::RetrieveAll;
.....
# Inside your script you will be able to use this modules
# methods on your table class or object as needed.
use ClassDBIBaseClass;
use URI::Escape;
use CGI;
my $cgi = CGI->new();
my $cdbi_plugin_html = Baseball::Master->html();
$cdbi_plugin_html->data_table->addRow('Last Name','First Name','Bats' , 'Throws' ,
'Height (ft)','(inches)',
'Weight','Birth Year' );
my %params;
map { $params{$_} =
uri_unescape($cgi->param("$_"))
} $cgi->param();
$cdbi_plugin_html->params( %params );
$cdbi_plugin_html->exclude_from_url([ 'page' ]);
# attribute style
# created based on params and exclude values from above
# auto sets the query_string value
$cdbi_plugin_html->url_query();
# set the page name (script)
$cdbi_plugin_html->page_name('cdbitest.pl');
# indicate which columns to display
$cdbi_plugin_html->display_columns( [ 'lastname','firstname',
'bats' ,'throws',
'ht_ft' ,'ht_in',
'wt' ,'birthyear' ]
);
# indicate which columns to exclude, inverse of display above
$cdbi_plugin_html->exclude_columns();
# indicate the base class to work with, this is optional,
# if you should create you object via a call to
# Class::DBI::Plugin::HTML vs. a Class::DBI sub class
# this assures the correct sub class is used for data collection
$cdbi_plugin_html->cdbi_class( 'Baseball::Master' );
# indicate the style of navigation to provide
$cdbi_plugin_html->navigation_style( 'both' );
print qq~Filter by First Letter of Last Name~;
print $cdbi_plugin_html->string_filter_navigation(
-column => 'lastname',
-position => 'begins',
);
print qq~~;
$cdbi_html->only('firstname');
print $cdbi_plugin_html->build_table();
my $nav = $cdbi_plugin_html->html_table_navigation();
print qq!$navn!;
$cdbi_plugin_html->add_bottom_span($nav);
print $cdbi_plugin_html->data_table;
UPGRADE WARNING
As of the .8 release there have been changes to the methods and how they work. It is likely that scripts built with older versions WILL break. Please read below to find specific changes that may negatively impact scripts built using the the releases prior to .8. The .9 release contains some minor modifications that could in some chases break your scripts, test carefully before upgrading in a production environment.
Product's homepage
Requirements:
· Perl