Welcome Guest, Not a member yet? Register   Sign In
Basic Page Function
#3

Returning views as data

From the manual:

There is a 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:

$string = $this->load->view('myfile', $data, true);
echo $string;
Reply


Messages In This Thread
Basic Page Function - by Tux - 10-22-2014, 12:48 AM
RE: Basic Page Function - by Rufnex - 10-22-2014, 01:27 AM
RE: Basic Page Function - by John_Betong - 10-22-2014, 06:16 AM
RE: Basic Page Function - by John_Betong - 10-22-2014, 06:20 AM
RE: Basic Page Function - by Rufnex - 10-22-2014, 09:45 AM
RE: Basic Page Function - by navotjer - 10-24-2014, 04:29 AM
RE: Basic Page Function - by jlp - 10-25-2014, 06:35 AM
RE: Basic Page Function - by puppy - 11-04-2014, 08:11 AM
RE: Basic Page Function - by kilishan - 10-25-2014, 08:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB