[solved]Adding Dynamic Data to the View from the controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [solved]Adding Dynamic Data to the View from the controller (/showthread.php?tid=31423) |
[solved]Adding Dynamic Data to the View from the controller - El Forum - 06-18-2010 [eluser]Unknown[/eluser] Hi! I need to add Data to the View. I know i can make it with this: Code: $this->load->view('someview', $data); Can i somehow watch, what data-s i have in the view? So, i need to list all the users in my database. i have this: Code: $usersdb=$this->User_model->getUsers(); Code: array(3) { I tried it in a lot of way, but it never worked... Thanks:Koli [solved]Adding Dynamic Data to the View from the controller - El Forum - 06-18-2010 [eluser]tim1965[/eluser] you need to use foreach in your view and make you can see an example of this in the userguide for the database class section about returning data from queries [solved]Adding Dynamic Data to the View from the controller - El Forum - 06-18-2010 [eluser]pickupman[/eluser] Code: $data['usersdb'] = $this->User_model->getUsers(); [solved]Adding Dynamic Data to the View from the controller - El Forum - 06-19-2010 [eluser]Unknown[/eluser] Thanks! With the ->result, it don't work, but without that it's working! |