[eluser]djsuperfive[/eluser]
Hi,
I have a stupid question:
My controller calls a Model method to retrieve data from MySQL. I want to pass it to my view. But when i want to display the view in the browser, the $data in unknown and i get an error:
Code:
// following lines are in my controller
// and the var_dump is OK.
$data = $this->mUsers->getAll();
var_dump($data);
$this->load->view('vUsers', $data);
Code:
// following line are in my view
// and the var_dump generates an error.
<html>
<head>
<title>Les articles</title>
</head>
<body>
<h1>Les articles du site</h1>
<?
var_dump($data);
?>
</body>
</html>
And the error message in the browser :
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: views/vUsers.php
Line Number: 8