07-24-2011, 02:38 PM
[eluser]ivelin[/eluser]
In my controller
and my view
In my controller
Code:
function get_images(){
$file= scandir($this->gallery_path);
$file= array_diff($file, array('.', '..', 'thumbs'));
// print_r($file);
$image= array();
foreach ($file as $key=> $f){
$image[$key]['info']= array(
'url'=> $this->gallery_path_url.$f,
'thum_url' => $this->gallery_path_url.'thumbs/'.$f
);
}
$this->load->view('upload_success', $image);
}
and my view
Code:
<div id="images">
<?
foreach ($image as $row){ ?>
<div id="thumb">
<a href="<?php echo $row['url'];?>"><img src="<?php echo $row['thum_url']; ?>" /> </a>
</div>
<?php } ?>
</div>
Quote:A PHP Error was encounteredWhere is my mistake??
Severity: Notice
Message: Undefined variable: image
Filename: views/upload_success.php