![]() |
Array helper - more function required - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: Array helper - more function required (/showthread.php?tid=72773) |
Array helper - more function required - atishamte - 02-09-2019 I have gone through the ArrayHelper file and found only one function. There are multiple functions which we use in our development, which we wish to have in core helpers Can we suggest those as well to be a part of core functionality instead of custom? This might help all developers to get the one-stop solution Suggested functions can be,
RE: Array helper - more function required - InsiteFX - 02-09-2019 Here are a couple to get started with, I'll work on the others tomorrow. PHP Code: // ----------------------------------------------------------------------- PHP Code: // ----------------------------------------------------------------------- RE: Array helper - more function required - atishamte - 02-10-2019 I have the implementation of all these functions. I want to include itnin core codeigniter code base. But I don't know how to do this contribution. Please provide some video tutorial from where I can understand, how to contribute. RE: Array helper - more function required - kilishan - 02-10-2019 Some of those functions look like good additions, but any that wold be accepted would have to be significant improvements in usability over core PHP functions. array_sort_by_column would fit, since I'm assuming it handles multi-dimensional array sorting which is always a bit of a pain to manually do. Things like array_remove_empty_elements doesn't sound any different than array_filter so wouldn't accept that one. I don't have time to make a video on how to do contribution, but this should help: Contributing to CodeIgniter. Especially the link on Pull Requests. RE: Array helper - more function required - InsiteFX - 02-11-2019 PHP has almost all of the sorting functions / methods already for key / value and multi. That would be breaking kiss and dry. RE: Array helper - more function required - Onyx - 03-15-2019 There are tons of Core PHP Array functions, CI4 would just be wrapping them inside a helper - also I would imagine this would get insane: array_sort_by_column, array_sort_by_column_multi... for sorting based on an value that is nested.... hmmm --- array_sort_by_column could be done by: array_map_assoc / array_walk |