0

I got two controller in CodeIgniter, at the top of each one I load my library:

require_once(APPPATH.'/libraries/Client.php');

After that I load in the controller the session library with:

$this->load->library(array('session'));

Now when I create an object from the library in the first controller and place it in a session I'm not able to access it in the other controller. I get the following error:

__PHP_Incomplete_Class

Anyone know a solution for this one?

2
  • Can you put your code ? Commented Mar 7, 2017 at 6:58
  • It says that before using it , you should define it somewhere else, then and then only you can use it. TRY to load your libraries and helpers in autoload.php will be fesible solution. Commented Mar 7, 2017 at 9:22

1 Answer 1

0

Your loading session library in controller in a wrong way. Load the library in config/autoload.php file like below-

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

try this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.