CroogoNav::_replace PHP Method

_replace() protected static method

Replace a menu element
protected static _replace ( array &$target, string $path, array $options ) : void
$target array pointer to start of array
$path string path to search for in dot separated format
$options array data to replace with
return void
    protected static function _replace(&$target, $path, $options)
    {
        $pathE = explode('.', $path);
        $path = array_shift($pathE);
        $fragment = join('.', $pathE);
        if (!empty($pathE)) {
            self::_replace($target[$path], $fragment, $options);
        } else {
            $target[$path] = self::_merge($target[$path], $options);
        }
    }