You do something like this:
ReportBoard.php
<?php
namespace space\report;
use \koolreport\dashboard\CustomBoard;
class ReportBoard extends CustomBoard {
protected function actionIndex($request, $response)
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'link',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: token'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = $response;
$arr = json_decode($json, true);
$result = [];
foreach($arr["projects"] as $project)
{
array_push($result,[
"id"=>$arr["projects"]["id"],
"name"=>$arr["projects"]["name"],
"status.name"=>$arr["projects"]["status"]["name"]
]);
}
$this->renderView([
"result"=>$result
]);
}
} In the view file ReportBoard.view.php
<?php
namespace space\report;
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\LineChart;
//You can access through $this->result
THIS LINE HAVE A MISTAKE $result = $this->params()["result"];
var_dump($result);
?> <div class="report-content">
<div class="text-center">
<h1>Join</h1>
<p class="lead">Primer Grafico</p>
</div>
<h5 class="text-center">Primera tabla</h5>
<?php //Use associate array
Table::create(array(
"dataSource"=>$this->dataStore("array-datasource-name"),
"cssClass"=>array(
"table"=>"table-bordered table-striped table-hover"
)
));
?>
</div>