I have difficulty getting values inside an array variable in codeigniter Help me understand how this works once and for all I made a search in the database that is sent to the view by an array: Controller
$dados= array(
'perfil' => $this->perfil->perfil($id)
);
In the view I have the data that came from the controller.
I check my $ profile variable with var_dump($perfil)
and this appears:
Array
(
[0] => stdClass Object
(
[artigo_id] => 2
[artigo_titulo] => A volta de cristo
[artigo_imagem] => 8f5364fb6f5204224529ce3345073906.jpg
[artigo_autor] => Nativo Natan Melo
)
)
How do I get index information article_autor? I try to access
$perfil->artigo_autor;
More of an error:
Trying to get property of non-object.
How should I proceed?