CodeIgniter HMVC – Memperbaiki Error Message: Call to undefined method MY_Loader::_ci_object_to_array()

CodeIgniter HMVC – Memperbaiki Error Message: Call to undefined method MY_Loader::_ci_object_to_array()

CodeIgniter HMVC – Memperbaiki Error Message: Call to undefined method MY_Loader::_ci_object_to_array()

Saat menggunakan HMVC Codeigniter pada PHP versi 7.4, mengalamani error seperti ini :

CodeIgniter HMVC – Memperbaiki Error Message: Call to undefined method MY_Loader::_ci_object_to_array()

Bagaimana solusinya?

Ikuti langkah-langkah berikut ini :

1. Buka application/third_party/MX/Loader.php

2. Cari pada baris 300, tulisan seperti ini :

return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));

3. Hapus dan ganti menjadi sepeti ini :

if (method_exists($this, '_ci_object_to_array'))
{
    return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
} else {
    return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), '_ci_return' => $return));
}

4. Selesai

Selamat mencoba!

What's Your Reaction?

like
0
dislike
0
love
1
funny
0
angry
0
sad
0
wow
0