Forums / Developer / Sorting an array in a template
Patrick ALLAERT
Wednesday 17 August 2005 5:40:33 am
The only way I found how to sort an array in a template was:
{set arrayToSort = $arrayToSort|sort}
With the following in my template.ini:
PHPOperatorList[sort]=my_sort
And the following function somewhere in the code (index.php ?):
function my_sort( $array ) { sort( $array ); return $array; }
Enjoy :)
Patrick ALLAERT http://www.dixite.com/ http://users.pandora.be/patrick_allaert/