protected static function sortChildElements($array) {
        foreach($array as $i => $item){
            if(isset($item['children']) && is_array($item['children'])){
                uasort($array[$i]['children'], 'self::sortByOrder');
                $array[$i]['children'] = array_values(self::sortChildElements($array[$i]['children']));
            }
        }
        return $array;
    }
protected static function sortChildElements($array) {
        foreach($array as $i => $item){
            if(isset($item['children']) && is_array($item['children'])){
                uasort($array[$i]['children'], 'self::sortByOrder');
                $array[$i]['children'] = array_values(self::sortChildElements($array[$i]['children']));
            }
        }
        return $array;
    }
protected static function sortChildElements ( $ array ) { foreach ( $ array as $ i => $ item ) { if ( isset ( $ item [ 'children' ] ) && is_array ( $ item [ 'children' ] ) ) { uasort ( $ array [ $ i ] [ 'children' ] , 'self::sortByOrder' ) ; $ array [ $ i ] [ 'children' ] = array_values ( self :: sortChildElements ( $ array [ $ i ] [ 'children' ] ) ) ; } } return $ array ; }
Sort child elements from the menu array
@param array $array This should be a menu item array
@return array
Sort child elements from the menu array