I have an array in this way doing a var_drum.
array (size=1)
'articles' =>
array (size=36)
0 =>
object(stdClass)[134]
public 'id' => int 56
public 'title' => string 'prueba con servicio json es tt aa' (length=33)
public 'body' => string 'prueba de hoy' (length=13)
public 'created' => string '2018-06-22T19:49:34+00:00' (length=25)
public 'modified' => string '2018-06-22T19:49:34+00:00' (length=25)
and I want to pass this array in a foreach in a cakephp view
the controller has it this way
public function index()
{
$http = new Client();
$response = $http->get('http://localhost/paginaws/articles/index.json');
$json = $response->json;
$json = $response->body;
$jarray = json_decode($json);
//$jarray = json_decode( json_encode( $json ), true );
$valor = (array)$jarray;
$this->set(compact(['valor']));
}