We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c097cb commit e73fd2eCopy full SHA for e73fd2e
src/Controller/ConfigController.php
@@ -115,10 +115,18 @@ public function listAction(Request $request): JsonResponse
115
}
116
117
118
- foreach ($groups as $group) {
119
- $tree[] = $group;
+ $sortFunc = fn($a, $b) => strtolower($a['text']) <=> strtolower($b['text']);
+
120
+ //sort group children
121
+ foreach($groups as &$group){
122
+ usort($group['children'], $sortFunc);
123
124
125
+ //sort items
126
+ $tree = array_merge($tree, $groups);
127
128
+ usort($tree, $sortFunc);
129
130
return $this->json($tree);
131
132
0 commit comments