Welcome Guest, Not a member yet? Register   Sign In
Helper_array to class
#1

First of all, i ask the team for feedback.
I want to move the function code into a separate class/classes and place them in the \CodeIgniter\Features namespace. The helper itself will use the class methods.

Example
PHP Code:
if (! function_exists('dot_array_search')) {
    /**
    * Searches an array through dot syntax. Supports
    * wildcard searches, like foo.*.bar
    *
    * @return mixed
    */
    function dot_array_search(string $index, array $array)
    {
        return \CodeIgniter\Features\Array\DotArr::search($index$array)
    }

This will make it possible to use the functions of working with arrays in other classes directly, without unnecessary loading of the helper.
It will also be possible to hide internal functions that should not be called directly. For example as _array_search_dot.

While i plan to create two classes:
  1. \CodeIgniter\Features\Array\DotArr::class
  2. \CodeIgniter\Features\Array\Arr::class
Reply


Messages In This Thread
Helper_array to class - by iRedds - 01-01-2022, 12:27 AM
RE: Helper_array to class - by kenjis - 01-01-2022, 01:54 AM
RE: Helper_array to class - by iRedds - 01-01-2022, 01:09 PM
RE: Helper_array to class - by kilishan - 01-01-2022, 09:22 PM
RE: Helper_array to class - by Chivinsdev - 01-03-2022, 08:27 AM
RE: Helper_array to class - by iRedds - 01-03-2022, 08:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB