![]() |
Controller is not passing data to a view. Any Ideas? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Controller is not passing data to a view. Any Ideas? (/showthread.php?tid=17426) |
Controller is not passing data to a view. Any Ideas? - El Forum - 04-04-2009 [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. Controller is not passing data to a view. Any Ideas? - El Forum - 04-04-2009 [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; Controller is not passing data to a view. Any Ideas? - El Forum - 04-04-2009 [eluser]breizik[/eluser] Hi, $data should be an array, have a look in the user guide http://ellislab.com/codeigniter/user-guide/general/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 Controller is not passing data to a view. Any Ideas? - El Forum - 04-04-2009 [eluser]Zack Kitzmiller[/eluser] Thanks, I'm just an idiot. ![]() |