In SilverStripe 3.1 I can get a sorted list of Children
by doing the following:
$this->Children()->sort('Title', 'ASC');
But when I do this the capital letters (as a group) come before the lowercase (as a group); thus "D" comes before "a":
Aadb
Bdbdd
Cdbd
Dbddb
aeb
But I want a sort order like this:
Aadb
aeb
Bdbdd
Cdbd
Dbddb
How can I do this in SilverStripe?
EDIT
I found a similar question where Willr says:
Strange! I would have thought it would be case insensitive. You could simply export the array list as an array ($list->map()) then write your own sort logic.
Does anyone know how to do this?
I have tried the following but it does not return any results:
function SortedChildren(){
$sortChildren = $this->Children()->map();
natcasesort($sortChildren);
return $sortChildren;
}