-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Scott, list,
just a short idea how templates might ease the task you describe.
Think of your reporter as having at least two runmodes, an input form
for making choices and an output form for presentation of the
selected data.
The general idea would be to let the program(mer) concentrate on the
data, doing all his work behind the curtains of the html
presentation, and the designer do the make-up for the form and data.
Basically your app would have two templates (more if different
datasets need different presentations) which could be designed
without much knowledge of the program logic behind (let aside stuff
like colorisation of odd and even rows in an output table). Assumed
you just want to output lists of values, you would have a
<tmpl_loop name="loopname"> as central element of this template, and
the presentation is modified by the designer while your program just
fills in the data. Using for exampe DBI's great
selectall_arrayref('',{Slice =>{}}), which uses hashrefs inside the
arrayref, you could fill your loop directly with
$template->param(
loopname => $dbh->selectall_arrayref('your_statement', {Slice=>{}}),
);
and do all data provision in just one line.
Now when it comes to shared elements in the presentational level,
templates are again your friends: HTML::Template (to mention only the
one that is tightest coupled to CGI::Applications documentation and,
still, code) allows for inclusion of sub-templates. And there you
would place common presentation code - in a dynamic way because there
again you can do variable substitution.
The value of this is that you do not have to care at all if your
designer wants to change the look of the pages.
Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/>
iD8DBQFAZHYkxxUzQSse11ARAlu9AJ91e8MbuZjB3aPqSikFk2HONwHX4QCfalSo
+1wjFzbMPeuglHHXrlCY8fA=
=LktE
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.