How to send model return data and some single variable information to view page from controller function - 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: How to send model return data and some single variable information to view page from controller function (/showthread.php?tid=28987) |
How to send model return data and some single variable information to view page from controller function - El Forum - 03-26-2010 [eluser]mi6crazyheart[/eluser] Hey guys, I'm using CI from last 2 months in one of project. So , don't having so much sound knowledge about CI. But, can say gradually learning a lot. Right now I've stuck with a problem & really can't understand how to solve it. Actually, I've a controller function. Here are codes of the controller function... Code: function membermanage($DboardID,$UserID) Here in the controller , i'm extracting some info from a MODEL and sending those info to a VIEW page. I've successfully manage to do this. But, when i'm trying to send a another array (at here in controller: $data1) i can't getting any way..... for , how to send that $data1 with $data to the view page & access $data1 info in view page. Whether, i've to do some like this [ $this->load->view('board/manage_members_view',$data,$data1) ] or some else, i can't understand. Plz, if any body have any idea reply me soon. I Google a lot about on this issue but didn't get any satisfactory information. How to send model return data and some single variable information to view page from controller function - El Forum - 03-27-2010 [eluser]Ben Edmunds[/eluser] Simply add your $data1 to your $data array: Code: function membermanage($DboardID,$UserID) Then you will have whatever your query returns and data1 accessible from your view. I have to point out though that your naming conventions are very bad and will become a big issue as your application grows. For example, I would have the member_info() method also return the ID's and then the controller would look something like this: Code: function member_manage($dboardId,$userId) Have fun, How to send model return data and some single variable information to view page from controller function - El Forum - 03-27-2010 [eluser]mi6crazyheart[/eluser] Thanks a lot Ben for u'r quick reply. By d way, about that naming conventions..... Ya, i know my naming conventions is really getting wild. There is proverb u might have heard that... "Little Knowledge is very dangerous" . This d thing which has happened with me. From the beginning i couldn't able to take proper care of my naming conventions. Actually, i never used CI before this. So, i generally habituated with some different kind of naming conventions. But, as CI has it's some times it's own way of naming different files(Ex:Controller file...First letter should Capital) when i started use CI, i needed to change my style of naming files. So, I just couldn't able to choose the sweet-able way naming files & this is the result of it. Any way, thx again for u'r quick help. Hence forward, i'll take care of these naming conventions of files. |