Is it necessary to use dataStore or dataSources to be able to process the information?
$arr = json_decode($response, true);
$result = [];
foreach($arr['projects'] as $project) {
array_push($result, [
"Nombre"=>$project["name"],
"Id"=>$project["view_state"]["id"],
]);
}
Select::create(array(
"name"=>"name",
"dataSource"=>$this->dataStore($result),
"dataBind"=>array(
"text"=>"Nombre",
"value"=>"Id",
),
"attributes"=>array(
"class"=>"form-control"
)
));
Table::create(array(
"dataSource"=>$result
));
?>
</div>
</div>
<div class="form-group">
<button class="btn btn-primary">Buscar</button>
</div>
</div>
</form>
<?php
if($this->dataStore("Name")->countData()>0)
{
Table::create(array(
"dataSource"=>$result
));
} //var_dump($result) = array(10) { [0]=> array(2) { ["Nombre"]=> string(7) "Bes" ["id"]=> int(8) } [1]=> array(2) { ["Nombre"]=> string(16) "ClĂni" ["id"]=> int(12) } [2]=> array(2) { ["Nombre"]=> string(4) "Demos" ["id"]=> int(7) } [3]=> array(2) { ["Nombre"]=> string(9) "Fala" ["id"]=> int(13) } [4]=> array(2) { ["Nombre"]=> string(3) "IE" ["id"]=> int(9) } [5]=> array(2) { ["Nombre"]=> string(5) "Raa" ["id"]=> int(11) } [6]=> array(2) { ["Nombre"]=> string(19) "Segur" ["id"]=> int(15) } [7]=> array(2) { ["Nombre"]=> string(6) "Tes" ["id"]=> int(1) } [8]=> array(2) { ["Nombre"]=> string(4) "UD" ["id"]=> int(10) } [9]=> array(2) { ["Nombre"]=> string(7) "Sodi" ["id"]=> int(14) } }