title: smarty function assign php
body: <p>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:</p>
  
  <pre><code>$smarty-&gt;assign("mikaPhotos", getTheImages("SOMEPATH",400), true);
  </code></pre>
  
  <p>and my getTheImages function is:</p>
  
  <pre><code>getTheImages($path,$width){
   $dirname = $path; //the path
   $images = glob($dirname."*.png");//get the png images from directory
   foreach($images as $image) {
   echo '&lt;img src="'.$dirname.'/'.$image.'" width="'.$width.'" /&gt;&lt;br /&gt;';//echo all the images in SOMEPATH
   }
  }
  </code></pre>
  
  <p>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?</p>