KoolReport's Forum

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

Conditionally use of \koolreport\clients\BootstrapCSS; #2289

Closed Ron opened this topic on on Aug 19, 2021 - 2 comments

Ron commented on Aug 19, 2021

I want to have a IF that will include the BoostrapCSS as per a parameter that will be passed to the report on initialisation

Sebastian Morales commented on Aug 20, 2021

Probably create two classes, one without the trait and one with it and extends the former so that you don't need to copy its code:

class MyReport extends koolreport\KoolReport {
    ...
}
...
class MyReportWithBootstrapCSS extends MyReport { //extends MyReport class to use its settings and setup method
    use  \koolreport\clients\BootstrapCSS;
}
...
if (...) $report = new MyReport();
else if (...) $report = new MyReportWithBootstrapCSS();

Hope this helps.

Ron commented on Aug 20, 2021

Thanks it works

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