Every time you need to process data before show it to the end user you have to do some work on it. Usually that means field formating (date, floats), math operations, page formating, etc. That is what this classes can do for you in a organized way.
Think of a shop cart or a report being generated from SQL data. You have to
list products, add columns, multiply one column with another, etc. You may also
have to organize the result within groups (headers, subtitles), having a header
for each group. You may also need to show some totals from numeric columns or
format fields from dates and floats coming from the database so they dont show
up as ugly 8 or 12 decimal digits and strange date patterns to the user.
Sure, uou can deal with those problems directly each time you need, going each
field one by one, or you could use the Report class. Just feed in your data,
a HTML template and some definitions and you'll get a very nice html page to
show to the user.
Currently you can parse the data and:
The Report class in the package use several HTML templates classes to parse the result. To understand what a template is and how it works please reffer to the documentation of each supported class. Working suported template classes are PEAR::HTML_Template_IT and PEAR::HTML_Template_PHPLIB, from PEAR or phplib directly, this last template is kept for compatibility with some old work. PEAR::HTML_Template_Sigma is in the package but isnt working yet, i will fix that soon. The classes you will use besides having PEAR installed in you server are:
To choose the template classe you want to use, edit the Report.php and include,
or require once, the one you want.
That in the future should change to use a factory pattern.
This is not Alpha code as far as it is being used for at least 2-3 years in prodution e-commerce sites I am developing and maintaining.
Author: Sebastião Rocha Aladim Neto (a.k.a Neto, a.k.a toomuchcoffeman)
Contact me: rocha at i-node dot com
dot br, if you have any questions