CodeIgniter +HMVC 错误
CodeIgniter +HMVC error
第一次设置 CodeIgniter HMVC。当我 运行 代码时,我遇到了这个错误。遇到未捕获的异常类型:错误
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename:
C:\xampp\htdocs\ciall\hmvc\application\third_party\MX\Loader.php
Line Number: 300
Backtrace:
File:
C:\xampp\htdocs\ciall\hmvc\application\modules\foo\controllers\foo.php
Line: 23 Function: view
File: C:\xampp\htdocs\ciall\hmvc\index.php Line: 315 Function:
require_once
将此添加到 MY_Loader HMVC 和最新版本的 codeigniter 存在问题,最好使用此
Link这里https://pastebin.com/vNUhJCss
HMVC负责人还没修复
<?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));
}
}
希望对您有所帮助,请采纳回答
第一次设置 CodeIgniter HMVC。当我 运行 代码时,我遇到了这个错误。遇到未捕获的异常类型:错误
Message: Call to undefined method MY_Loader::_ci_object_to_array()
Filename: C:\xampp\htdocs\ciall\hmvc\application\third_party\MX\Loader.php
Line Number: 300
Backtrace:
File: C:\xampp\htdocs\ciall\hmvc\application\modules\foo\controllers\foo.php Line: 23 Function: view
File: C:\xampp\htdocs\ciall\hmvc\index.php Line: 315 Function: require_once
将此添加到 MY_Loader HMVC 和最新版本的 codeigniter 存在问题,最好使用此
Link这里https://pastebin.com/vNUhJCss
HMVC负责人还没修复
<?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));
}
}
希望对您有所帮助,请采纳回答