sort smarty array


/ Published in: Smarty
Save to your folder(s)

How to sort array in smarty template?

>> Create sort modifier file and save it in smarty / plugins with
modifier.sortby.php name
use this modifier in smarty template like...
{foreach item=item key=key from=$users|@sortby:"firstname"}
{$item.id}-{$item.firstname}
{/foreach}

URL: http://www.smarty.net/forums/viewtopic.php?t=1079&sid=044cd556ed67f6ee4ed47e7cdeccd3ca

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.