CodeIgniter Forums

Full Version: why this error?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]osgaldor[/eluser]
I'm creating test controllers and everything had been working okay until this last function I wrote to test the url helper. I'm now getting this error:
Fatal error: Undefined class constant 'CI_Controller' in C:\wamp\www\codeigniter\CodeIgniter_2.1.0\application\controllers\dorjeboard.php on line 5

on line 5 is the parent::CI_Controller; call in the constructor. WTH?

El Forum

[eluser]InsiteFX[/eluser]
Code:
parent::CI_Controller
// should be
parent::__construct();

El Forum

[eluser]osgaldor[/eluser]
THANKS!!!

El Forum

[eluser]osgaldor[/eluser]
isthat two underscores?__

El Forum

[eluser]InsiteFX[/eluser]
Yes, both have double underscores.
Code:
public function __construct()
{
    parent::__construct();
}

El Forum

[eluser]osgaldor[/eluser]
Ok, that worked, but it just loaded my next view appended on to the same page. I'm using the url helper, how do I get it to completely reload the page?

El Forum

[eluser]osgaldor[/eluser]
Never mind. I have a big booboo in my HTML.

El Forum

[eluser]osgaldor[/eluser]
So for the constructor you don't name it the same name as the class? I named it the class name, not __construct();

El Forum

[eluser]InsiteFX[/eluser]
It should be the way I showed you above that is the PHP 5 constructor.

Naming the constructor with the class name is PHP 4 way.

El Forum

[eluser]osgaldor[/eluser]
Ok. Thanks. I've been watching some older tutorials I guess.
Pages: 1 2