Pass two Controller variables to Codeigniter view

Asked

Viewed 25 times

0

I would like to pass two variables from Controller to Codeigniter view, follow code:

$lista_diversos['diversos'] = $this->diversos->getDiversos();
$listacodigos['codigos'] = $this->diversos->getCodigos();
$this->template->load('template', 'diversos/indexDiversos', $listacodigos, $lista_diversos);

the two are working, when I pass any of them as the first I can pick up the view, but the second I can’t recover in the view, what can I do?

  • vc only passes an argument that is an array with multiple keys.

  • can you give me an example?

  • 1

    $dados['diversos'] = $this->diversos->getDiversos(); $dados['codigos'] = $this->diversos->getCodigos(); $this->template->load('template', 'diversos/indexDiversos', $dados);

  • 1

    worked out, thanks

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.