PHP Coding Tips

Thursday, March 28, 2013

Sample smarty loop with images

If you want to print several images on your site, you must assign array of those images to smarty variable. Then, you can iterate over this array in smarty and show img tags for each image. Rember about good path:{foreach from=$sm_photos item=item} <img src="/content/photophoto/1/{$item.file}"> {/foreach}If your path will not target image file, you can get 404 error, but typically image will be just hidden

No comments:

Post a Comment