0
这里是modules
库中的文件夹结构笨3 HMVC:无法加载会话库
用户 - > controllers-> Users.php
用户 - > config-> autoload.php
welcome-> controllers->的welcome.php
autoload.php
$autoload = array(
'helper' => array('url', 'form'),
'libraries' => array('session')
);
的welcome.php(位于模块/首页/的welcome.php)
class Welcome extends MX_Controller {
public function index()
{
//load module
$this->load->module(array('users'));
}
}
我会收到以下错误:
Unable to locate the specified class: Session.php
注: url
和form
库正确加载
它也产生同样的错误消息 –
它应该工作:( 你试试这其中也
class Welcome extends CI_Controller { public function __construct() { parent::__construct(); $this->library->load('session'); } .......... }
–但加载另一个模块,我需要在我的welcome.php文件扩展问题类MX_Controller看 –