CodeIgniter HMVC object_to_array()错误 [英] CodeIgniter HMVC object_to_array() error
问题描述
HMVC: https://bitbucket.org/wiredesignz/codeigniter-modular- extensions-hmvc / downloads
下载CI并通过HMVC复制后,出现以下错误:
After downloading CI and copying over the HMVC, I'm getting the following error:
遇到未捕获的异常
An uncaught Exception was encountered
类型:错误
消息:调用未定义的方法MY_Loader :: _ ci_object_to_array()
Message: Call to undefined method MY_Loader::_ci_object_to_array()
文件名:
/Users/k1ut2/Sites/nine.dev/application/third_party/MX /Loader.php
Filename: /Users/k1ut2/Sites/nine.dev/application/third_party/MX/Loader.php
行号:300
回溯:
文件:/Users/k1ut2/Sites/nine.dev/application/controllers/Welcome.php
行:23功能:视图
File: /Users/k1ut2/Sites/nine.dev/application/controllers/Welcome.php Line: 23 Function: view
文件:/Users/k1ut2/Sites/nine.dev/index.php行:315功能:
require_once
File: /Users/k1ut2/Sites/nine.dev/index.php Line: 315 Function: require_once
推荐答案
只需在此处将其添加为Lin Clasyk提供的k当前不起作用...
Just adding this here as the Link provided by Clasyk isn't currently working...
该线程的简短版本可以归结为......
The short version from that thread boils down to this...
在application / third_party / MX / Loader.php中,您可以执行以下操作...
In application/third_party/MX/Loader.php you can do the following...
在公共功能视图下($视图,$ vars = array(),$ return = FALSE)
寻找...(第300行)
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));
用
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));
}
这是CI开发人员实施的少量无记录变更的结果,
It's the result of a "little" undocumented change that the CI Devs implemented, which is fine!
Wiredesignz上有一个拉动请求正在等待操作,因此他知道这件事...
There is a pull request on Wiredesignz awaiting action so he knows about it...
在此期间,您可以实现上面的 diddle并返回编码:)
In the meantime, you can implement the above "diddle" and get back to coding :)
这篇关于CodeIgniter HMVC object_to_array()错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!