I see no reason to mention that you are using HTML::Template, get_users() should suffice. HTML::Template, Template Toolkit, Class::DBI, and Mason all pretty much expect the same kind of data structures, so i wouldn't bother appending the templating name into your method names.
However, these days i have been using Class::DBI and class methods to retrieve such data, so i can make my own Customer class and use it like so:
Class::DBI takes care of creating getter and setter methods for you. And there is also the "poor man's object" method by simply using DBI's selectall_arrayref() method:use Customer; my @customer = Customer->retrieve_all();
Now $customers contains a data structure ready to be passed to an HTML::Template <TMPL_LOOP> tag. :)my $customer = $dbh->selectall_arrayref( "SELECT customer_id, username FROM customer", { Slice => {} } );
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Consistent naming for methods that return HTML::Template prepped data?
by jeffa
in thread Consistent naming for methods that return HTML::Template prepped data?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |