Welcome Guest, Not a member yet? Register   Sign In
what $string = $this->load->view('myfile', '', true) exactly does?
#4

[eluser]mddd[/eluser]
Code:
$string = $this->load->view('blogview',$data,true);
$this->load->view('blogview',$string);
With this code you are loading 'blogview' with $data (given your earlier example, that contains a title etc) and saving it to $string. That's fine.
But than you are loading the view AGAIN. This time passing $string. Why? This would put the total view inside itself!

The error is because you need to pass an array to the view. The keys of that array then become variables in the view.
So if you pass $data['title'] = 'My Title'; to the view, in the view you would use $title to display the value 'My Title'.


Messages In This Thread
what $string = $this->load->view('myfile', '', true) exactly does? - by El Forum - 08-20-2010, 04:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB