Reputation: 5858
Here is the folder structure in modules
library
users->controllers->Users.php
users->config->autoload.php
welcome->controllers->Welcome.php
autoload.php
$autoload = array(
'helper' => array('url', 'form'),
'libraries' => array('session')
);
Welcome.php (located in modules/welcome/Welcome.php)
class Welcome extends MX_Controller {
public function index()
{
//load module
$this->load->module(array('users'));
}
}
I will get the following error :
Unable to locate the specified class: Session.php
Note:
url
and form
libraries are loaded correctly
Upvotes: 0
Views: 1352
Reputation: 63
please load session in index function
$this->load->library('session');
Add this part in your function
Upvotes: 0
Reputation: 136
In config/autoload.php file put below line
$autoload['libraries'] = array('database','form_validation','session');
Its work fine for me.
Upvotes: 0