One of the most repetitive work on web applications are the creation of lists of data. Generally all the lists on the application have similar characteristics and same looking. Some time ago i will do all the job by hand on every list, this make me crazy after some dozens of similar lists.
To save some time i create the CGI::List module. This is the result after some years of development and use.
#List
my $list = CGI::List->new(
dbh => $dbh,
sql => {
select => "*",
from => "countries",
limit => "20",
},
);
#Print the list
print $list->print();
Whit this code i have an html list whit auto order and pagination.
Easy i can put a link on each row using the row key as a cgi param.
link => {
key => "id_country",
hidde_key_col => 1,
location => "params.pl",
transit_params => {aditional_param => "param_value"}
},
If you like how sound this, go to:
http://www.cgi-list.com to see all the examples.
The CGI::List features are:
Columns name autodetection,
Auto Order,
Auto Pagination,
CSS Based,
Columns Totals (SUM, COUNT, AVG),
Conditional row formats based on a cell value,
Conditional cell formats based on a cell value,
Http links based on rows key.