\CGExtensions\reportsformatted_report_generator

A class to generate a report using a special template for each row or item.

Summary

Methods
Properties
Constants
__construct()
set_template()
generate()
get_output()
No public properties found
No constants found
get_template()
process_template()
each_row()
report()
start()
finish()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

set_template()

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.

Parameters

string $tpl

The template contents.

generate()

generate() : void

Generate the report output.

get_output()

get_output() : mixed

Get the generated output.

This method may return textual data suitable for echoing/displaying. Or it it may generate a static file and return nothing.

Returns

mixed

get_template()

get_template() : string

Get the document template.

Returns

string

process_template()

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.

Parameters

string $tpl

The name of the template to process.

each_row()

each_row(array $row)

A callback functon for each data row.

Parameters

array $row

The row returned from the query.

start()

start() : void

A callback function when the report is started.

finish()

finish() : void

A callback function for when the report is finished.