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

[eluser]smilie[/eluser]
Hi,

Goal: pass data to the view, so it can be used in view;

Code:
Code:
$test = array('text' => 'some text');
$tmp_data['main_content_view'] = $this->load-view('content/profile',$test,TRUE);

In content/profile:
Code:
print_r($test);

But I am getting error:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: test
Filename: content/profile.php
Line Number: 8

For some reason, it seems as my variable is not being received by the view?

Tho' I am not sure if this is some config / setting in CI or am I doing something wrong? :-)

Thanks!
Smilie


Messages In This Thread
Passing data to view - by El Forum - 07-20-2010, 07:03 AM
Passing data to view - by El Forum - 07-20-2010, 07:06 AM
Passing data to view - by El Forum - 07-20-2010, 07:08 AM
Passing data to view - by El Forum - 07-20-2010, 07:09 AM
Passing data to view - by El Forum - 07-20-2010, 07:10 AM
Passing data to view - by El Forum - 07-20-2010, 07:11 AM
Passing data to view - by El Forum - 07-20-2010, 07:15 AM
Passing data to view - by El Forum - 07-20-2010, 07:32 AM
Passing data to view - by El Forum - 07-20-2010, 09:09 AM
Passing data to view - by El Forum - 07-20-2010, 09:13 AM
Passing data to view - by El Forum - 07-20-2010, 09:13 AM
Passing data to view - by El Forum - 07-20-2010, 09:15 AM
Passing data to view - by El Forum - 07-20-2010, 09:16 AM
Passing data to view - by El Forum - 07-20-2010, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB