2016-08-23 76 views
0

這裏是modules庫中的文件夾結構笨3 HMVC:無法加載會話庫

  1. 用戶 - > controllers-> Users.php

    用戶 - > config-> autoload.php

  2. 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 

注: urlform庫正確加載

回答

0

在配置/ autoload.php文件下面放線

$autoload['libraries'] = array('database','form_validation','session'); 

它的工作對我罰款。

+0

它也產生同樣的錯誤消息 –

+0

它應該工作:( 你試試這其中也 class Welcome extends CI_Controller { public function __construct() { parent::__construct(); $this->library->load('session'); } .......... }

+0

但加載另一個模塊,我需要在我的welcome.php文件擴展問題類MX_Controller看 –