View Single Post
  #1  
Old 10-13-2011, 05:09 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Sorting Array in Smarty Alphabetically

Hi All,

I was wondering, is there some way of using a foreach loop in smarty and sorting alphabetically. I am retrieving a list of Newlists from the DB on the register screen, so in register.tpl I am stepping through. Similar to:

Code:
{foreach from $newslists item=z} {assign var="id" value=$z.listid} {if $z.listid lt 5} HTML HERE including {$z.name} {/if} {/foreach}

I would like to build the list of checkboxes ordered by name. Does anyone know how to do this?

Thanks,
FWM.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote