Welcome Guest, Not a member yet? Register   Sign In
Passing data to view
#11

[eluser]smilie[/eluser]
Hi Juan,

If TRUE is set at the end, then view (probably HTML code in there) will not be sent to the users screen but will be stored as data.

In example:

Code:
$tmpdata['header'] = $this->load->view('content/profile',$test,TRUE);

Following will 'happen':
1. view content/profile is 'loaded' and $test variable is passed;
2. result of that view (HTML page) will be saved in $tmpdata['header'] instead of being sent to the users screen;

After that, you can do:

Code:
$this->load->view('content/mainpage',$tmpdata);

which will activate page 'mainpage' with the page 'profile' ready for use.

I am using this to separate header / content / footer. This way I prepare header and footer beforehand and just pass them to the mainpage which presents them.

Regards,
Smilie
#12

[eluser]smilie[/eluser]
mddd,

Did you mean:

$this->email->message(); instead of $this->db->message() ?

Regards,
Smilie
#13

[eluser]mddd[/eluser]
Of course Smile I am working on so many database, I am automatically typing '$this->db' ...
Time to stop working for today, I guess!

I have changed it in my post, so people won't get confused. Thanks.
#14

[eluser]Juan Velandia[/eluser]
Muchas Gracias!

A very fast and clear explanation!

Best regards!!




Theme © iAndrew 2016 - Forum software by © MyBB