Skip to content
Advertisement

Call to undefined method CI_Controller::Controller()

I have got this controller:

JavaScript

it tells me in this line:

parent::Controller(); //error here.

JavaScript

If I remove that line..I get an error for the next line that says..

JavaScript

How do I prevent such errors form happening?

Advertisement

Answer

If you’re using CI 2.x then your class constructor should look like this:

JavaScript

read more in user guide

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement