问题描述
我在CI2(使用HMVC)中启动了一个模块化项目。我正在将项目移动到CI 3。
I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3.
我试图使用config / autoload .php
I am trying to autoload the session library using config/autoload .php
$autoload['libraries'] = array('database','session');
我收到此错误:
Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158
即使使用$ this-> load-> library('session')手动加载控制器中的库,同样的错误。
Even if a manually load the library within the controller using $this->load->library('session'), i get the same error.
我相信这是使用HMVC导致的错误。我已经设法使CI 3模块化,但我困在这个问题,请帮助...
I am convinced this is an error caused by using HMVC. I have managed to make CI 3 modular but I am stuck with this issue, please help...
我可以加载助手&但我无法加载库:(
I can load helpers & models but I cant load libraries :(
推荐答案
我认为你有错误的HMVC版本,你需要下载最新版本 https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/downloads a>
I think you have wrong version of HMVC you need to download the latest version https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/downloads
点击分行,您将看到2个版本。
Click on branches and you will see 2 versions.
这篇关于当使用CI 3与HMVC时无法加载库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!