i have a function in smarty that checks if the row called "mikaphotos" is empty. If the row is empty, it's ok and doesnt happen anything, and if it's not empty..it takes the value in $path variable. Now my assin is:
$smarty->assign("mikaPhotos", getTheImages("SOMEPATH",400), true);
and my getTheImages function is:
getTheImages($path,$width){
$dirname = $path; //the path
$images = glob($dirname."*.png");//get the png images from directory
foreach($images as $image) {
echo '<img src="'.$dirname.'/'.$image.'" width="'.$width.'" /><br />';//echo all the images in SOMEPATH
}
}
now in my file.tpl .. i put:{$mikaPhotos} and it's not working. I think there is some problem in my code, but i do not know how to do that. any help please?