Welcome Guest, Not a member yet? Register   Sign In
A little help for a newbie
#5

[eluser]CroNiX[/eluser]
The array that gets passed to the view must be an associative array as CI will extract() that array into variables in the view so you can access its keys using $key.
Code:
$data['thisdat'] = 'This data';
$data['otherdat'] = 'Some other data';
$this->load->view('view_file', $data);

...In view

Code:
echo $thisdat; //outputs 'This data'
echo $otherdat; //outputs 'Some other data'


Messages In This Thread
A little help for a newbie - by El Forum - 01-18-2012, 12:22 PM
A little help for a newbie - by El Forum - 01-18-2012, 12:27 PM
A little help for a newbie - by El Forum - 01-18-2012, 12:32 PM
A little help for a newbie - by El Forum - 01-18-2012, 12:35 PM
A little help for a newbie - by El Forum - 01-18-2012, 12:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB