【问题标题】:An uncaught Exception was encountered in hmvc在 hmvc 中遇到未捕获的异常
【发布时间】:2018-04-18 19:07:03
【问题描述】:

遇到未捕获的异常

类型:错误

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

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

行号:300

【问题讨论】:

  • 欢迎来到 Stack Overflow!请提供Minimal, Complete, and Verifiable Example 如何重现异常。目前很难理解你在问什么。
  • 一个简单的谷歌搜索会帮助您立即解决这个问题。

标签: codeigniter


【解决方案1】:

试试这个。将其添加到 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));
    }
}

【讨论】:

    猜你喜欢
    • 2019-04-03
    • 1970-01-01
    • 1970-01-01
    • 2020-05-30
    • 1970-01-01
    • 1970-01-01
    • 2023-01-28
    • 2019-03-10
    • 1970-01-01
    相关资源
    最近更新 更多