... but very busy these days. Here goes!
Some of you probably tried using PHP's usort() method to... sort stuff. Well, it might seem unclear how it works with the Zend Framework.
As you know, this is how it should be used1:
usort ( array &$array , callable $cmp_function )
However, in a Zend Framework controller, you have to change things just a little bit to make it work:
usort($to_sort, array($this, 'sorting_method'));
I shouldn't have to explain that $to_sort is your array of data you want to sort and 'sorting_method' is your sorting method (duh).
1: http://www.php.net/usort
No comments:
Post a Comment