2
Let’s say I have an Array $testes
that receives 2 Arrays $variavel1
and $variavel2
. So I do $this->set('testes', $testes)
to use in the view.
In View how I access the values of $variavel1
and $variavel2
? I made a foreach and tried $testes['$variavel1']['campo']
, but it only gives one Undefined Index
in $variavel1
.
Example, how to access data from this Array?
Array (
[0] => Array (
[ProcuraProdutoPedOnline] => Array (
[cd_familia] => 3
[ds_familia] => ACESSORIOS
)
)
[1] => Array (
[ProcuraProdutoPedOnline] => Array (
[cd_familia] => 1
[ds_familia] => CALCADOS
)
)
)
And
Array (
[0] => Array (
[VwEstPedOnline] => Array (
[cd_seq_pedido] => 2034
)
)
[1] => Array (
[VwEstPedOnline] => Array (
[cd_seq_pedido] => 2038
)
)
)
$testes
is receiving like this : $testes = array($cdSeqPeds, $familias);
I’ve tried it this way, it only prints 2034 due to [0], and identifies Procuraprodutopedonline as Undefined, and cd_familia null.
– Edson Rodrigues