Skip to content

Commit

Permalink
Merge pull request #3417 from insiders/menu-order
Browse files Browse the repository at this point in the history
[AdminBundle] Menu order
  • Loading branch information
acrobat authored Apr 28, 2024
2 parents 2d71d76 + 458f93a commit 212f82d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Kunstmaan/AdminBundle/Helper/Menu/MenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public function getChildren(?MenuItem $parent = null)
$menuAdaptor->adaptChildren($this, $result, $parent, $request);
}

usort($result, function ($a, $b) {
return $a->getWeight() <=> $b->getWeight();
});

return $result;
}

Expand Down

0 comments on commit 212f82d

Please sign in to comment.