$arr = json_decode($response, true);
$result = [];
foreach($arr['projects'] as $project) {
array_push($result, [
"Nombre"=>$project["name"],
"Id"=>$project["view_state"]["id"],
]);
}
echo $this->dataStore('Name')->count();
Select::create(array(
"name"=>"name",
"dataSource"=>$this->dataStore($result),
"dataBind"=>array(
"text"=>"Nombre",
"value"=>"Id",
),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</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
));
}