View Single Post
Old 11-24-2009, 01:12 PM   #4 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

The second argument of $this->load->view(); takes the array with values. The arraykeys (names) of easy value in the array is transformed into a variable in the view itself. (extract() function)

So when I call the view like this from my controller:

$this->load->view('test', array('test' => 'hello world'));

I can read it like this in my view:

My testvalue: <?=$test?>
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote