__construct()
__construct(\CGExtensions\reports\formatted_report_defn $rpt)
Object constructor.
Parameters
| \CGExtensions\reports\formatted_report_defn | $rpt | The report definition. |
A class to generate a report using a special template for each row or item.
__construct(\CGExtensions\reports\formatted_report_defn $rpt)
Object constructor.
| \CGExtensions\reports\formatted_report_defn | $rpt | The report definition. |
get_output() : mixed
Get the output of the report, after generation.
This method may return textual data suitable for echoing/displaying. Or it it may generate a static file and return nothing.
The output of this class depends upon the content of the report, and item templates passed to this object.
set_template(string $tpl)
Set the template to be used for formatting the document.
The document template is a smarty template that should at the minimum consist of a {foreach $items as $item}...{/foreach} loop. Each item in the loop will be an HTML string representing each formatted item.
| string | $tpl | The template contents. |
report() : \CGExtensions\reports\report_defn
Get the report definition.
process_template(string $tpl)
Process the specififed template through smarty.
This method will attempt to find the current action module, and given that and the name of the template find the template contents. if the template name ends with .tpl a module file template is assumed. Otherwise, a module database template will be assumed. If a module cannot be determined, then a file template is assumed, using the 'file' smarty resource.
| string | $tpl | The name of the template to process. |