I'm trying to send a array data from a controller to a view. but, a log of the framework accuse: Message: Undefined variable: var.
this is the "fake data" of my controller, the "n":
class Produtos extends CI_Controller{
public function index()
{
$n= [];
$form = [
"greetings" => "welcome",
"user" => "Name:",
"password" => "Pass:",
"copyright" => "2016"
];
array_push($n, $form);
$dados = ["n" => $n];
$this->load->view("n/index.php");
}
}
and, my view named "n" have only a var_dump:
<?= var_dump($n);>
someone can help?
<?=var_dump($n);?>