fixed for erro 'Call to undefined method MY_Loader::_ci_object_to_array()'

#24 Open
Repository
wiredesignz
Branch
codeigniter-3.x

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update codeigniter-3.x
hg pull -r jaystream/fixed-for-erro-call-to-undefined-method--1504394897012 https://bitbucket.org/jaystream/codeigniter-modular-extensions-hmvc
hg merge jaystream/fixed-for-erro-call-to-undefined-method--1504394897012
hg commit -m 'Merged in jaystream/codeigniter-modular-extensions-hmvc/jaystream/fixed-for-erro-call-to-undefined-method--1504394897012 (pull request #24)'
Author
  1. Jay-r Simpron
Reviewers
Description

fixed for erro 'Call to undefined method MY_Loader::_ci_object_to_array()'

Comments (1)

  1. RGSHARON

    You Will Get Errors in PHP 7.2 like this

    Message: The each() function is deprecated. This message will be suppressed on further calls

    to fix this ,

    Make a New Static Function in Modules.php and Place it inthe Bottom of the file before the Clas Ends.

    public static function makeEach(&$arr)
        {
                $key = key($arr);
    
                $result = ($key === null) 
                    ? false 
                    : [$key, current($arr), 'key' => $key, 'value' => current($arr)];
    
                next($arr);
    
                return $result;
        } 
    

    Then change the

     (is_array($module)) ? list($module, $params) = each($module) : $params = NULL; 
    

    To,

    (is_array($module)) ? list($module, $params) = Self::makeEach($module) : $params = NULL;