KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to use KoolReport with smarty ? #1727

Open prestamagician opened this topic on on Nov 23, 2020 - 3 comments

prestamagician commented on Nov 23, 2020

HI, I need to understand how to use KoolReport with smarty. Best regards

KoolReport commented on Nov 27, 2020

It is pretty simple that you save the render content of KoolReport to a variable and then echo in the view of smarty:

$report = new MyReport;
$report_content = $report->run()->render();

You assign the $report_content to the template data of smarty and inside view of smarty you do:

<div>
{$report_content}
</div>
prestamagician commented on Nov 27, 2020

HI, if I do that: $report = new MyReport; $report_content = $report->run()->render(); even if I use true in the render like that: $report_content = $report->run()->render(true); the report is automatically displayed in my controller not in my smarty view.

KoolReport commented on Nov 27, 2020

Ah yes, I forgot about that. You are right it should be ->render(true) for content to be returned. It should not render there in controller if true is passed to render() function. Not sure if there is any special settings that causes this behavior. I will consult dev.team and come back to you.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None