CodeIgniter HMVC object_to_array() error

Just adding this here as the Link provided by Clasyk isn't currently working...

The short version from that thread boils down to this...


In application/third_party/MX/Loader.php you can do the following...


Under public function view($view, $vars = array(), $return = FALSE) Look for... (Line 300)

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

Replace this with
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));
} 


It's the result of a "little" undocumented change that the CI Devs implemented, which is fine!

There is a pull request on Wiredesignz awaiting action so he knows about it...

In the meantime, you can implement the above "diddle" and get back to coding :)




Source :

https://stackoverflow.com/questions/41557760/codeigniter-hmvc-object-to-array-error

Comments