-1
I was watching a tutorial and the video of the instructor that was posted did not give this error, and now it is with me:
Array to string Conversion on line 28
I already looked for a solution and the videos told me to put one echo
, but I already put it and it didn’t work.
private function GetLista(){
$i = 1;
while($lista = $this->ListarDados()):
$this->itens[$i] = array(
'cate_id' => $lista['cate_id'],
'cate_nome' => $lista['cate_nome'],
'cate_slug' => $lista['cate_slug'],
'cate_link' => Rotas::pag_Produtos(). '/' .$lista['cate_id'] . '/' . ['cate_slug']
);
$i++;
endwhile;
}
Speak there, Still! In this question I edited to fix. For your next, read formatting. Another thing: the error occurs on line 28. But your code does not have 28 lines... How about pointing, in this code, which is line 28? ;D
– LipESprY
Hello, sorry and I did not know the formatting, but in the next posts I will put :p
– Still
Taking a superficial look, I found a mistake here:
'cate_link' => Rotas::pag_Produtos(). '/' .$lista['cate_id'] . '/' . ['cate_slug']

. That part:['cate_slug']
should be$lista['cate_slug']
, nay?! :)– LipESprY
Hello, thank you that was the same mistake, unfortunately it was a mistake of mine at the time of typing, thank you for helping me, have any part of posting for beginners? Or I can publish in general?
– Still
The ideal is to do the [tour] and give a brief read on help center. If you’ve already found the problem, I’ll formulate an answer and we’ll call this one off. =)
– LipESprY
Hello Still. I believe the @Lipespry-defolga- response is correct. If it has solved the problem, you are the only one able to approve it. See more here > https://pt.meta.stackoverflow.com/a/1079/15361
– Andrei Coelho