KoolReport's Methods
List of methods #
__construct() #
Construct the report, parameters is optional.
__construct($params)
Example:
$report = new MyReport();
$report = new MyReport(array(
"myParam"=>"KoolReport is awesome!"
));
run() #
Run the report, KoolReport start pulling data and piping them through various processes. Data after processing will be available in dataStores for later usages.
->run()
Example:
$report = new MyReport;
$report->run();
render() #
Render report, the $return
is optional with default false
value. When $return
is true
, the render() will return the string instead of sending content to browser.
->render([string $view], [bool $return])
Example:
$report = new MyReport;
$report->run();
$report->render();
$content = $report->render(true);
//If you have another view
$report->render("AnotherView");
$content = $report->render("AnotherView",true);
dataStore() #
After report is run, data will be stored at dataStores, you can access them with dataStore
method
->dataStore(string $storeName)
Example:
$report = new MyReport;
$report->run();
$result = $report->dataStore("result");
toArray() #
Return all dataStores in array format.
->toArray()
Example:
$report = new MyReport;
$report->run();
$result = $report->toArray();
toJson() #
Return all dataStores in JSON format.
->toJson()
Example:
$report = new MyReport;
$report->run();
echo $report->toJson();
getXml() #
Return all dataStores in XML format.
->getXml()
Example:
$report = new MyReport;
$report->run();
echo $report->getXml();
Get started with KoolReport
KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.