Welcome Guest, Not a member yet? Register   Sign In
Can't use __construct() when i'm extending from MY_Controller
#1

[eluser]coldscooter[/eluser]
Here's what i'm trying to do:

class SomeClass extends MY_Controller{

function __construct(){
parent::__contruct();
}

}

And here's what my MY_Controller looks like:

class MY_Controller extends CI_Controller {

function __contruct () {
parent::__contruct();
}
}

I get a fatal error "Call to undefined method CI_Controller::__contruct()"

Any help would be appreciated.
#2

[eluser]johnpeace[/eluser]
Check your spelling...
#3

[eluser]CroNiX[/eluser]
What version of CI? Those constructs only work in CI2+. Before that it used php4 style syntax.

Also, make sure your MY_Controller is located in /application/core, since it's a core extension.
#4

[eluser]CroNiX[/eluser]
[quote author="johnpeace" date="1336583551"]Check your spelling...[/quote]Ha! That too. I usually catch that kind of thing. Good eye.




Theme © iAndrew 2016 - Forum software by © MyBB