Friday, August 21, 2009
Smarty foreach
Smarty Foreach
The following is the smarty code snippet explaining how to use foreach in smarty
Code #1:
Code #2:
Resources:
http://smarty.net/manual/en/language.function.foreach.php
The following is the smarty code snippet explaining how to use foreach in smarty
Code #1:
{foreach key=key item=item from=$arrayname}
{$key}: {$item}
{/foreach}
Code #2:
{foreach from=$myArray key=k item=v}
{$k}: {$v}
{/foreach}
- from => the array that needs to be processed
- key => key value of the array (if it is an associative array)
- key => value of the array[key] (if it is an associative array)
Resources:
http://smarty.net/manual/en/language.function.foreach.php
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment