Questions
I have a public folder is where my webserver will load with starting. I put koolreport folder in the same folder with public, that's why there is no way that web user can access the resources (js,css) of koolreport widgets. How can I make the report run? P/S: Under the public folder, I have a folder called assets where I store all the js and css resources.
Answer:
You do this:
<?php
class MyReport extends \koolreport\KoolReport
{
public function settings()
{
return array(
"assets"=>array(
"path"=>"../assets",
"url"=>"/assets"
)
);
}
}
In the settings()
function of KoolReport, you place the property assets
. In the path
property, we will set relative path from the report to the assets folder. In the url
property, we set the url pointing to the assets folder.
By this settings, Widget of KoolReport know where to copy resource to and how to access the resource.