Welcome Guest, Not a member yet? Register   Sign In
MVC Hierarchy question.
#4

[eluser]Sarfaraz Momin[/eluser]
Well I don't know weather I understood your problem completely but I think this is what you want. You want to display a footer in all your pages and show some data from the controller in that footer but since you are calling the footer in the page view you are not able to get the data array passed to the footer view. If I am correct here what you can do:

refer user guide: Loader Class

Code:
$this->load->view('file_name', $data, true/false)

The third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way. If you set the parameter to true (boolean) it will return data. The default behavior is false, which sends it to your browser. Remember to assign it to a variable if you want the data returned:

that means, you have to set the last parameter to TRUE! then you can echo multiple views.
Code:
echo $this->load->view(’myfile’, $data, true);
echo $this->load->view(’myfile2’, $footerdata, true);

Hope this makes sense.

Good Day !!!


Messages In This Thread
MVC Hierarchy question. - by El Forum - 12-25-2007, 05:52 PM
MVC Hierarchy question. - by El Forum - 12-25-2007, 10:38 PM
MVC Hierarchy question. - by El Forum - 12-26-2007, 02:13 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 04:12 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 04:25 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 05:26 AM
MVC Hierarchy question. - by El Forum - 12-26-2007, 09:03 PM
MVC Hierarchy question. - by El Forum - 12-26-2007, 11:59 PM
MVC Hierarchy question. - by El Forum - 12-30-2007, 05:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB