Welcome Guest, Not a member yet? Register   Sign In
passing array to views
#1

[eluser]emsurban[/eluser]
can any help me figure out the problem in this code. What I would like to do is pass a file list to views.

controller code:
Code:
$path = base_url().'/images/';
    $data['images'] = get_filenames($path,TRUE);
  
    $this->load->view('gallery_view',$data);

views code:

Code:
<?php foreach($images as $image):?>

<?php echo $image; ?>

<?php endforeach;?>


I got this error
Quote:Message: Invalid argument supplied for foreach()

Can any help me, i'm a newbie to CI. Thanks in advance.


Messages In This Thread
passing array to views - by El Forum - 06-27-2009, 03:44 PM
passing array to views - by El Forum - 06-27-2009, 03:56 PM
passing array to views - by El Forum - 06-27-2009, 03:58 PM
passing array to views - by El Forum - 06-27-2009, 09:40 PM
passing array to views - by El Forum - 06-28-2009, 06:34 PM
passing array to views - by El Forum - 06-29-2009, 06:48 AM
passing array to views - by El Forum - 06-29-2009, 09:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB