![]() |
pass a parameter to the view - 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: pass a parameter to the view (/showthread.php?tid=39009) |
pass a parameter to the view - El Forum - 02-26-2011 [eluser]dianikol85[/eluser] Hi to all. I'll keep it short Let's say we have a controller and within it two methods. 1) index 2) call_index In the index method i load a view. In the call_index i call the index but i want to pass a parameter to the view when i run the call_index method. Here is an example of the code Code: class Welcome extends CI_Controller { I don't think so that to load the view again in the call_index is a good practice because i probably have already passed data in the index method. For example a pagination. How i can pass the $data['data'] in the view within the call_index method. pass a parameter to the view - El Forum - 02-26-2011 [eluser]Cristian Gilè[/eluser] Code: class Welcome extends CI_Controller in the view: Code: ... Cristian Gilè pass a parameter to the view - El Forum - 02-26-2011 [eluser]dianikol85[/eluser] is there a way without passing it as a variable in the index(). In my case i have already passed to it the variables of the offset for doing the pagination. So i don't want to view it from the url pass a parameter to the view - El Forum - 02-26-2011 [eluser]Cristian Gilè[/eluser] Code: class Welcome extends CI_Controller Cristian Gilè pass a parameter to the view - El Forum - 02-26-2011 [eluser]dianikol85[/eluser] Thank you Cristian. This is going to work!! |