在hmvc中遇到未捕获的异常

时间:2018-04-18 19:07:03

标签: codeigniter

遇到未捕获的异常

  

输入:错误

     

消息:调用未定义的方法MY_Loader :: _ ci_object_to_array()

     

文件名:C:\ xampp \ htdocs \ hhh \ application \ third_party \ MX \ Loader.php

     

行号:300

1 个答案:

答案 0 :(得分:0)

试试这个。将其添加到MY_Loader中。

<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader
{
    /** Load a module view **/
    public function view($view, $vars = array(), $return = FALSE)
    {
        list($path, $_view) = Modules::find($view, $this->_module, 'views/');

        if ($path != FALSE)
        {
            $this->_ci_view_paths = array($path => TRUE) + $this->_ci_view_paths;
            $view = $_view;
        }

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