KoolReport's Forum

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

Error in AssetManager #191

Open David Willink opened this topic on on Jan 11, 2018 - 9 comments

David Willink commented on Jan 11, 2018

Fatal error: Call to a member function publishAssetFolder() on null

[........./class/reports/koolreport/core/AssetManager.php:55]

I want to render the widget to a variable so that it can be output thru a view template that doesn't use embedded PHP in it. Perhaps I am missing something.

I am using the FatFreeFramework and trying to setup KoolReport to work. Recommendations appreciated.

This is partial code in a controller to create data into variables for the view.

require_once $apppath . "/class/reports/koolreport/autoload.php";
use \koolreport\datagrid\DataTables;
$t = DataTables::create(array(
         "data"=>array(
                array("name"=>"Peter","age"=>35),
                array("name"=>"Karl","age"=>31),
                )
          ))
     );

Thank you.

KoolReport commented on Jan 11, 2018

I guess you use it not in KoolReport view file so you should use the Instant package to load:

require_once $apppath . "/class/reports/koolreport/autoload.php";
use \koolreport\datagrid\DataTables;
use \koolreport\instant\Widget;
Widget::create(DataTables::class,array(
    "data"=>array(
        array("name"=>"Peter","age"=>35),
        array("name"=>"Karl","age"=>31),
    )
));
David Willink commented on Jan 11, 2018

The data for the widget is displaying at the top of the <body>

<table id="datatables5a57a154934231" class="display">
    <thead>
        <tr>
            <th>name</th>
            <th>age</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Peter</td>
            <td>35</td>
        </tr>
        <tr>
            <td>Karl</td>
            <td>31</td>
        </tr>
    </tbody>
</table>
KoolReport commented on Jan 11, 2018

So you put the <?php Widget::create ... inside the <body> tag

David Willink commented on Jan 11, 2018

I cannot include PHP code in the framework VIEW templates. That is their design.
I need to render the widget to a variable that I can include inside the framework view template.

Thanks.

KoolReport commented on Jan 11, 2018

What I have seen here, The FatFreeFramework support PHP in template.

David Willink commented on Jan 11, 2018

Ah yes. I have been using their template language for so long (Template::instance()->render()) I forgot about rendering plain views (View::instance()->render()).

Thank you.

David Willink commented on Jan 11, 2018

Sorry to be so many questions. The table is generated. Yay! I have added to "options" for colsort, select row, etc. but does not show. Is there something else to turn on? Thank you.

David Willink commented on Jan 12, 2018

Ok. Got some of the operations going. Had to put the jquery in the head tag.

KoolReport commented on Jan 12, 2018

That's right

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
help needed
solved

DataGrid