Welcome Guest, Not a member yet? Register   Sign In
Not able to pass data to a view
#2

[eluser]techgnome[/eluser]
take a look at how it's shown in this thread: http://ellislab.com/forums/viewthread/167509/

you need to load your data into an associative array and pass the array to the view...

Using your code, it would look like this:
Code:
$dat['map'] = directory_map('.');
$this->load->view('showfolders', $data);

when CI loads a view, it converts the array into variables for you... so in your view, $map will exist so you can use it just like you are.

-tg


Messages In This Thread
Not able to pass data to a view - by El Forum - 09-16-2010, 04:39 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 05:46 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 05:48 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:09 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:19 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:48 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 07:03 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 08:03 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 09:52 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 02:49 PM
Not able to pass data to a view - by El Forum - 09-16-2010, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB