Controller is not passing data to a view. Any Ideas? |
[eluser]Zack Kitzmiller[/eluser]
I am having the same issue as the poster, and I can't seem to resolve it. I can echo out the data in the $data variable in the controller, but it is not getting passed into the view. My Controller: Code: function retrieve_customer() and my edit_customer view: Code: </head> And my model: Code: function retrieve_customer() This is driving me crazy, and I'm sure it's something I'm just overlooking. Thanks.
[eluser]jalalski[/eluser]
You don't use the $data variable directly, you use what it contains. e.g. $data['name'] = 'John'; $data['age'] = 42; and in the view: echo $name; echo $age;
[eluser]breizik[/eluser]
Hi, $data should be an array, have a look in the user guide http://ellislab.com/codeigniter/user-gui...views.html , paragraph "Adding Dynamic Data to the View" the example is Code: $data = array( and it's passing three variables to the view: $title, $heading and $message
|
Welcome Guest, Not a member yet? Register Sign In |